Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Every form has it's own icon in the taskbar 1

Status
Not open for further replies.

Nordlund

Programmer
Joined
Jul 17, 2001
Messages
458
Location
SE
Hi there.
Normally, only the project has the icon in the taskbar.
(Only one icon /application)

I want to add a special form in my application, and that form has to have a corresponding icon in the taskbar, is that possible?

KungTure-RX.jpg

//Nordlund
 
sure, no problem :

override the createparams method to achive this :
Code:
type
  TForm1 = class(TForm)
  protected
    procedure CreateParams(var Params: TCreateParams); override;
....

procedure TForm1.CreateParams(var Params: TCreateParams);

begin
 // change window style to have an icon in the taskbar
 // to do this we add WS_EX_APPWINDOW to the window style parameters
 // for more info ,look into MS win32 help reference on msdn
 inherited CreateParams(Params);
 ParentWindow:=GetDesktopWindow; // make sure desktop is owner of this form, if not, taskbar button will not function properly
 Params.ExStyle := WS_EX_APPWINDOW;
end;

Cheers,
Daddy

--------------------------------------
What You See Is What You Get
 
THanks, I will look in to that in a moment... [2thumbsup]

KungTure-RX.jpg

//Nordlund
 
...A star for the first solution... Thanks...

KungTure-RX.jpg

//Nordlund
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top