發表文章

Delphi TButton How to make Delphi TButton control stay pressed?

 https://stackoverflow.com/questions/46934591/how-to-make-delphi-tbutton-control-stay-pressed    Vcl.Themes,   Vcl.Styles ; StyleAPI StyleElements FInternalImageList  TSeStyle procedure TSysStyleHook.UpdateColors; begin   if (OverrideEraseBkgnd) or (OverridePaint) then     Color := StyleServices.GetStyleColor(scWindow)   else     Color := clBtnFace;   if OverrideFont then     FontColor := StyleServices.GetSystemColor(clWindowText)   else     FontColor := clBlack; end; procedure TSysStyleHook.SetStyleElements(Value: TStyleElements); begin   if Value <> FStyleElements then     begin       FStyleElements := Value;       OverridePaint := (seClient in FStyleElements);       // OverrideEraseBkgnd := OverridePaint;       OverridePaintNC := (seBorder in FStyleElements...

delphi DataSource TDataSetProvider local data

 MyBaseを試してみる。(フィールド作成編): Delphi-fan http://hiderin.air-nifty.com/delphi/2011/09/mybase-dcff.html  http://delphi.ktop.com.tw/board.php?cid=30&fid=66&tid=51084   https://blog.karatos.in/a?ID=00200-12c89300-5e82-48ad-ada0-aab6e1319adf https://stackoverflow.com/questions/67149100/how-to-detect-user-either-in-dbgrid-or-clientdataset-has-deleted-data-in-a-cell https://www.delphipower.xyz/guide_6/working_with_data_using_a_client_dataset.html delphi DataSource TDataSetProvider  Advanced Data TableGram ADTG https://docwiki.embarcadero.com/Libraries/Sydney/en/Data.Win.ADODB.TPersistFormat https://torry.net/quicksearchd.php?String=dataset&page=6

https://github.com/osmanatam/delphi-foundations

 https://github.com/osmanatam/delphi-foundations  https://github.com/zhugecaomao/DelphiSourceCodeCollection FMX Utilities Tweaks to TClipboard code to compile with newer FMX versions   Misc/Generics.Defaults if done with metaclasses   XE2 book  01. Language basics 02. Enums, numbers, dates and times 04. Classes and records 05. String handling 06. Arrays, collections and enumerators 07. Basic IO 08. Streams Cleaned up source for fuller visual control demo 09. ZIP, XML, Registry and INI files 10. Packages 11. Dynamic typing and expressions 12. RTTI 13. Native APIs Make comment more precise 14. Dynamic libraries 15. Multithreading Another little FileSearchThread.pas thing

delphi image TResourceStream standard Microsoft SDK resource compiler

  standard Microsoft SDK resource compiler  https://github.com/graphics32/GR32PNG  RC.EXE, the Microsoft SDK Resource Compiler https://forum.lazarus.freepascal.org/index.php?topic=12312.0 https://www.wireshark.org/docs/wsdg_html_chunked/ChToolsMSChain.html https://support.microsoft.com/en-us/topic/an-updated-resource-compiler-for-the-windows-sdk-for-windows-server-2008-and-for-the-net-framework-3-5-is-now-available-a716ac6a-19a7-5b45-b5df-55980cd4cdb4 https://archicadapi.graphisoft.com/documentation/graphisoft-resource-compiler-4 https://docs.microsoft.com/zh-tw/windows/win32/menurc/resource-compiler https://en.wikibooks.org/wiki/Windows_Programming/Resource_Scripts Var    jpg: TJPEGImage;  resStream: TResourceStream; begin   jpg := TJPEGImage.Create;   resStream := TResourceStream.Create(HInstance, 'testJpg', 'jpgtype');   jpg.LoadFromStream(resStream);   Image1.Picture.Assign(jpg);   jpg.Free;   resStream.Free; end; //RC: te...

Spiral transform image algorithm rotatey region around

 [ GDI+ サンプル ] [ G080_RotateTransform による画像とオブジェクトの回転 ] - Mr.XRAY https://stackoverflow.com/questions/65163260/image-transformation-python  https://medium.com/analytics-vidhya/opencv-perspective-transformation-9edffefb2143  https://en.wikipedia.org/wiki/Archimedean_spiral#General_Archimedean_spiral  https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4  The Rick Sammon Swirl Effect https://www.geeks3d.com/20110428/shader-library-swirl-post-processing-filter-in-glsl/

delphi form Transparent blur Msimg32.dll AlphaBlend

 https://stackoverflow.com/questions/5964701/how-to-draw-a-translucent-image-on-a-form transparent background http://delphiexamples.com/forms/transpform.html  https://sourceforge.net/projects/widget32/ https://parnassus.co/transparent-graphics-with-pure-gdi-part-2-and-introducing-the-ttransparentcanvas-class/  Form com área transparente no Lazarus/Windows  http://fanzinepas.blogspot.com/2012/06/form-com-area-transparente-no.html THandle CreateRectRgn CreateRectRgn SetWindowRgn Winuser.h https://www.codeguru.com/cplusplus/transparent-listbox/ https://stackoverflow.com/questions/48511634/partially-transparent-window-opengl-win32   winapi Transparent form layer GetMonitorInfo https://www.experts-exchange.com/articles/1783/Win32-Semi-Transparent-Window.html Layered Windows https://docs.microsoft.com/en-us/previous-versions/ms997507(v=msdn.10)?redirectedfrom=MSDN https://www.codeproject.com/Articles/1822/Per-Pixel-Alpha-Blend-in-C  http://suyamasoft.blue.coocan....

swig parsing llvm parsing Delphi2Cpp conversion C++ translating Pascal Delphi

https://github.com/FMXExpress/swig-delphi https://blog.mbedded.ninja/programming/languages/python/python-swig-bindings-from-cplusplus/ https://code.google.com/archive/p/swig-gsoc/wikis/ProjectIdeas.wiki https://en.delphipraxis.net/topic/940-delphi-compiler-need-to-be-opensourced/?page=4 https://swig-devel.narkive.com/qhi42Zwz/delphi-module https://www.swig.org/ https://www.swig.org/Doc1.3/Extending.html https://stackoverflow.com/questions/38884979/parsing-a-header-file-using-swig https://stackoverflow.com/questions/10373935/pascal-to-c-converter https://sites.google.com/a/chromium.org/dev/blink/webidl https://en.wikipedia.org/wiki/Comparison_of_parser_generators https://en.wikipedia.org/wiki/Source-to-source_compiler https://en.wikipedia.org/wiki/Language_binding https://wiki.freepascal.org/C_to_Pascal https://wiki.lazarus.freepascal.org/User:Roozbeh https://discourse.panda3d.org/t/help-with-swig/570     Developer Tools Code Code Convertors https://torry.net/pages.php?id=...

How can I change the background color of a button WinAPI C++

 Rectangles, Regions, and Clipping rectangular region CreateRoundRectRgn   https://miffyzzang.tistory.com/378 CreateWindow("button","",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_BITMAP | BS_OWNERDRAW,   100,100,70,30,hWnd,(HMENU)IDC_BUTTON, hInst,NULL); Creating Owner-Drawn Controls - Windows Programming BS_OWNERDRAW   SetButtonStyle SetWindowRgn https://stackoverflow.com/questions/18745447/how-can-i-change-the-background-color-of-a-button-winapi-c https://www.pablosoftwaresolutions.com/html/cimagebutton.html #pragma comment( \     linker, \     "/manifestdependency:\"type='win32' \     name='Microsoft.Windows.Common-Controls' \     version='6.0.0.0' \     processorArchitecture='*' \     publicKeyToken='6595b64144ccf1df' \     language='*'\"") https://www.pablosoftwaresolutions.com/html/ccolorbutton.html https://stackoverflow.com/questions/17678261/how-t...

PraButtonStyle Button with very attractive layout, standard bootstrap to Delphi VCL

 https://github.com/pauloalvis/Delphi-PraButtonStyle

RkSmartButton rkGlassButton

 https://rmklever.com/?tag=rkglassbutton Klever on Delphi My take at Delphi, tips and tricks and how tos Skip to content     HomeAbout Contact Downloads Tag Archives: rkGlassButton     Glassbutton updated to v2.4 3 Comments     This is a long forgotten update to my rkGlassButton component. Some bugs have been corrected and it now work more as expected. The first ting first. The autosize property is working like it should. Secondly the down property also work when duostyle is active. Last but not forgotten OnClick now work as expected. Please report any bugs you find to me. Hope this helps a little Download rkGlassButton v2.4 This entry was posted in Component, GUI and tagged Component, GUI, rkGlassButton on August 19, 2014. Klever on Delphi My take at Delphi, tips and tricks and how tos Skip to content     HomeAbout Contact Downloads A smarter button 8 Comments     There is a lot of buttons out there I know ...

TColorButton - button with Color properties unit ColorButton;

  unit ColorButton;   { Article:   TColorButton - button with Color properties   http://delphi.about.com/library/weekly/aa061104a.htm   Full source code of the TColorButton Delphi component, an extension to the standard TButton control, with font color, background color and mouse over color properties.   }   interface   uses Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, Buttons, ExtCtrls;   type TColorButton = class ( TButton ) private FBackBeforeHoverColor: TColor; private FCanvas: TCanvas; IsFocused: Boolean ; FBackColor: TColor; FForeColor: TColor; FHoverColor: TColor; procedure SetBackColor ( const Value: TColor ) ; procedure SetForeColor ( const Value: TColor ) ; procedure SetHoverColor ( const Value: TColor ) ;   property BackBeforeHoverColor : TColor read FBackBeforeHoverColor write FBackBeforeHoverColor; protected procedure CreateP...

unit ColorButton;

 https://delphisources.ru/pages/faq/base/change_button_color.html Изменить цвет TButton {   You cannot change the color of a standard TButton,   since the windows button control always paints itself with the   button color defined in the control panel.   But you can derive derive a new component from TButton and handle   the and drawing behaviour there. } unit ColorButton; interface uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,   StdCtrls, Buttons, ExtCtrls; type   TDrawButtonEvent = procedure(Control: TWinControl;     Rect: TRect; State: TOwnerDrawState) of object;   TColorButton = class(TButton)   private     FCanvas: TCanvas;     IsFocused: Boolean;     FOnDrawButton: TDrawButtonEvent;   protected     procedure CreateParams(var Params: TCreateParams); override;     procedure SetButtonStyle(ADefault: Bo...

how-to-change-the-color-of-tbutton BS_OWNERDRAW SetWindowLong WM_DRAWITEM BS_OWNERDRAW color properties TColorButton

  Buttons and Similar Controls https://docwiki.embarcadero.com/RADStudio/Sydney/en/Buttons_and_Similar_Controls https://blogs.embarcadero.com/creating-a-custom-button-style-with-rad-studio-10-seattle/ https://docs.microsoft.com/en-us/windows/win32/controls/button-styles https://stackoverflow.com/questions/23082687/how-to-change-the-color-of-tbutton BS_OWNERDRAW SetWindowLong WM_DRAWITEM BS_OWNERDRAW to expose working color properties: TColorButton TColorButton = class(TButton) private ... procedure DrawItem(const DrawItemStruct: TDrawItemStruct); ... with Params do Style := Style or BS_OWNERDRAW; https://stackoverflow.com/questions/55731281/delphi-button-transitions-using-vcl https://stackoverflow.com/questions/9758016/how-do-i-custom-draw-of-tedit-control-text https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/tcolorbutton.html https://community.embarcadero.com/es/blogs/entry/creating-a-custom-button-style-with-rad-studio-10-seattle https://torry.net/quicksearchd.php?String=butto...

...show controls with rounded corners?

 https://www.swissdelphicenter.ch/en/showcode.php?id=921  www.teamb.com  Autor: P. Below Homepage: http://www.teamb.com [ Print tip ]          Tip Rating (38):            procedure MakeRounded(Control: TWinControl); var   R: TRect;   Rgn: HRGN; begin   with Control do   begin     R := ClientRect;     rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, 20, 20);     Perform(EM_GETRECT, 0, lParam(@r));     InflateRect(r, - 5, - 5);     Perform(EM_SETRECTNP, 0, lParam(@r));     SetWindowRgn(Handle, rgn, True);     Invalidate;   end; end; procedure TForm1.Button1Click(Sender: TObject); begin   // TMemo:   Memo1.BorderStyle := bsNone;   MakeRounded(Memo1);   // TEdit:   Edit2.BorderStyle := bsNone;   MakeRounded(Edit2);   // TPanel:   Make...

Receive Windows Messages In Your Custom Delphi Class NonWindowed Control AllocateHWnd(WndMethod); TMsgReceiver RegisterWindowMessage TApplicationEvent

 https://zarko-gajic.iz.hr/receive-windows-messages-in-your-custom-delphi-class-nonwindowed-control-object/

Embed the Chromium web browser in your Delphi projects

 https://github.com/salvadordf/CEF4Delphi https://github.com/salvadordf/WebView4Delphi  https://landof.dev/awesome/pascal/ https://github.com/Fr0sT-Brutal/awesome-pascal

Using Delphi’s Expressions Engine EXPR math parser library parsing evaluating expressions

https://blogs.embarcadero.com/using-delphis-expressions-engine/ https://github.com/torvalds/linux/blob/master/scripts/kconfig/expr.c  https://beltoforion.de/en/muparser/ C++ Mathematical Expression Library (ExprTk) - By Arash C library for parsing and evaluating simple expressions.  evaluating  expressions  https://stackoverflow.com/questions/1326258/mathematical-expression-parser-in-delphi  https://github.com/Crownie88/Delphi-mathematic-expression-parser/blob/master/MathExpParser.pas

一起結束

 https://codeoncode.blogspot.com/2016/12/create-job-object-and-terminate-child.html Create a Job object And terminate Child Process JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag How to gracefully handle when main.exe terminated, child.exe terminated also? You need to use jobs. Main executable should create a job object, then you'll need to set JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag to your job object.   unit JobsApi; interface uses   Windows; type   TJobObjectInfoClass   =   Cardinal;   PJobObjectAssociateCompletionPort   =   ^TJobObjectAssociateCompletionPort;   TJobObjectAssociateCompletionPort   =   Record       CompletionKey     :   Pointer;       CompletionPort   :   THandle;   End;   {$EXTERNALSYM JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION}   JOB_OBJECT_LIMIT_BREAKAWAY_OK = $00000800...

提升權限

 OpenProcessToken GetCurrentProcessID   TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY  CreateProcessAsUser SystemHandleInformation = 16; ProcessBasicInformation = 0; STATUS_SUCCESS = cardinal($00000000); SE_DEBUG_PRIVILEGE =20; STATUS_ACCESS_DENIED = cardinal($C0000022); STATUS_INFO_LENGTH_MISMATCH = cardinal($C0000004); SEVERITY_ERROR = cardinal($C0000000); TH32CS_SNAPPROCESS = $00000002;   JOB_OBJECT_ALL_ACCESS = $1f001f; printf("SeCreateSymbolicLinkPrivilege = %ld, %ld\n", seCreateSymbolicLinkPrivilege.HighPart, seCreateSymbolicLinkPrivilege.LowPart);       if (!GetTokenInformation(hProcess, TokenPrivileges, NULL, 0, &length))       {         if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)         {           TOKEN_PRIVILEGES* privileges = (TOKEN_PRIVILEGES*)malloc(length);     ...

advapi32.dll advapi32.lib AbortSystemShutdown InitiateSystemShutdown 關機 重新 開機

 https://docs.microsoft.com/zh-tw/windows/win32/shutdown/displaying-the-shutdown-dialog-box