22 Votes

Delphi: Show other Windows in addition to to the Main Window in the Taskbar

Tip by Progger99 | 2011-12-24 at 20:52

If you are writing a Delphi application with more than one windows (forms), normally only the main window of your program appears in the taskbar, so that only this main window can be opened by using the taskbar. All of the other windows can be seen on the desktop but not in the taskbar, so that a window quickly can "disappear", when it is hidden behind another window. 

If you want to display other windows next to the main form in the taskbar, you can use the following code:

protected
  procedure CreateParams(var Params: TCreateParams); override;
 
//...
 
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.ExStyle   := Params.ExStyle or WS_EX_APPWINDOW;
  Params.WndParent := GetDesktopWindow;
end;

The procedure CreateParams can just be copied to the unit of each form or window that should be displayed in the taskbar. It is important that you declare the procedure under "public" and not as "private". If the area "protected" is missing in your unit, you can simply create it over the private declarations.

ReplyPositiveNegative

About the Author

AvatarThe author has not added a profile short description yet.
Show Profile

 

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.