Average rating:
This article explains how to manipulate form appearance on Windows XP by adding drop shadow effect. 
Step 1:

Create a new form or modify main form. In the form code for example frmShadow, override CreateParams() method with your own.

Type:

 TfrmShadow = class(TForm)
 private
  { Private declarations }
 public
  { Public declarations }
 protected
  procedure CreateParams(var Params: TCreateParams); override; end

Complete form declaration by pressing CTRL+SHIFT+C. Delphi IDE will add implementaion of CreateParams.

Step 2:

Because drop shadow effect will only work on Windows XP or later, you need to make sure that we add drop shadow only when we know the operating system is Windows XP.

function IsWinXP: Boolean; begin

Result:= (Win32Platform = VER_PLATFORM_WIN32_NT) and
          (Win32MajorVersion >= 5) and (Win32MinorVersion >= 1); end

Step 3:

Last we add drop shadow effect by modifiying Style of WindowClass bit inside CreateParams.

procedure TfrmShadow.CreateParams(var Params: TCreateParams);
const CS_DROPSHADOW = $00020000;
begin inherited;

if IsWinXP then begin Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW; end

Zamrony P Juhara's picture
About this Author:
Zamrony P Juhara is a Delphi programmer from Indonesia currently living in Surabaya. He is very interested in DirectX programming topics. Currently, he maintains his own website, http://juhara.com, where he posts his DirectX programming articles.
View more information and all guides by Zamrony P Juhara