Author: Jonas Bilinkevicius
How do I make it so that only the form I select comes to the top (i.e. without the
main form)?
Answer:
Try this in any secondary window that you don't want dragging the program along:
1 { ... }2 private3 { Private declarations }4 5 procedure CreateParams(var Params: TCreateParams); override;
6 { ... }7 8 procedure TForm2.CreateParams(var Params: TCreateParams);
9 begin10 inherited CreateParams(Params);
11 Params.WndParent := GetDesktopWindow;
12 end;
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.