Mega Code Archive

 
Categories / Delphi / Examples
 

How to keep a form always in the background [bottommost]

By assigning the desktop handle to be the form's parent, it will always be in the backgroud, even when it gets focused. procedure TForm.CreateParams(var Params: TCreateParams); begin { TForm.CreateParams } inherited CreateParams(Params); if Assigned(Application.MainForm) then begin Params.WndParent := GetDesktopWindow; Params.Style := WS_CHILD end; { Assigned(Application.MainForm) } end; { TForm.CreateParams }