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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Taskbar icons

Status
Not open for further replies.

1Derry

Programmer
Apr 9, 2001
10
0
0
US
I've got a SDI Delphi application. Is it possible to suppress the creation of a new icon in the taskbar every time a new form is created. I would just like the one icon which, when selected, displays all the created forms with the latest on top. Thanks.
 
lDerry,

Try adding (or calling) something like this to the formCreate events:

Code:
procedure TfrmMainForm.FormCreate(Sender: TObject);
var
   liWinStyle : Longint;
begin

  with Application do
  begin
     liWinStyle := getWindowLong( handle, GWL_EXSTYLE );
     showWindow( handle, SW_HIDE );
     setWindowLong( handle, GWL_EXSTYLE,
                    liWinStyle or WS_EX_TOOLWINDOW );
     showWindow( handle, SW_SHOW );
  end;

end;

This is what I use when creating applications that are hidden from the task bar. I'm not sure how you're getting your forms showing up, but the basic tachnique should be the same. You would probably have to pass the form's Handle in your case.

Hope this helps...

-- Lance
 
Thanks for the reply Lance.

I copied your code into the Create procedure of my 'NewForm' word for word but no joy. It compiled and ran okay but still placed an additional icon in the task. Are there some parts I have to substitute to make it relevant to my app?

I call the form from another form as below like....

NewForm := TNewForm.Create(self);
NewForm.RunAProcedure;
NewForm.ShowModal;
NewForm.Free;

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top