How to Convert TColor to a Hex String and Vice Versa

Posted December 15th @ 9:12 pm by m3Rlin

Delphi uses TColor to represent colors but HTML requires a string name (139 colors have names in the web palette) or a hex number. Here’s the code to convert a TColor color value to hex a string and vise versa.
The functions use the Windows API GetRValue(), GetBValue(), GetGValue() and RGB() functions.
!Note: If your are going [...]

How to Remove the Form’s Caption

Posted December 15th @ 8:57 pm by m3Rlin

You may have wanted to create a form that doesn’t have a caption bar, just like the one’s you may see in setup programs. Delphi VCL doesn’t give you but you can also use the Windows API
Just add this code to you form’s OnCreate method:

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and not WS_CAPTION);
Height := Height - [...]

« Previous EntriesNext Entries »