How do you make a form appear on the taskbar in Delphi? In Firefox, for example, when you open a page in a new window, it creates another window on the taskbar without creating a new process. At the moment my Delphi application opens a new form when a button is clicked, but there is still only one thing on the task bar, so you can't alt-tab between the main form and the form that is created when the button is clicked. How do I change it so that the new form appears with a new taskbar button? My current code looks like this:
procedure Form1ButtonClick(Sender: TObject);
begin
Form2.Show;
end;
I have been messing around with CreateWindowEx
, but ideally I would like to find a simpler solution than directly using the Windows API.
Change your taskbar settingsPress and hold or right-click any empty space on the taskbar, and then select Taskbar settings. In the Taskbar settings, scroll to see the options for customizing, choosing icons, and much more.
To pin apps to the taskbarSelect Start , scroll to the app you want to pin, then press and hold (or right-click) the app. Select More > Pin to taskbar. If the app is already open on the desktop, press and hold (or right click) the app's taskbar icon, and then select Pin to taskbar.
If I understand what you want correctly, you can show your secondary forms on the task bar by overriding it's CreateParams procedure, as explained in Minimize child forms independent of the main form delphi.about.com article, like this:
interface
type
TMyForm = class(TForm)
...
protected
procedure CreateParams(var Params: TCreateParams) ; override;
...
implementation
procedure TMyForm.CreateParams(var Params: TCreateParams) ;
begin
inherited;
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
Params.WndParent := 0;
end;
if not using of this line is better in form order :
Params.WndParent := 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With