2010. január 3., vasárnap

Show a secondary form without the main form


How do I make it so that only the form I select comes to the top (i.e. without the main form)?


Try this in any secondary window that you don't want dragging the program along:

{ ... }
{ Private declarations }

procedure CreateParams(var Params: TCreateParams); override;
{ ... }

procedure TForm2.CreateParams(var Params: TCreateParams);
  inherited CreateParams(Params);
  Params.WndParent := GetDesktopWindow;

By setting the form's parent window handle to the desktop, you remove the link that would normally force the whole application to come to the top when this form comes to the top.

Nincsenek megjegyzések:

Megjegyzés küldése