Board index » delphi » Hiding App in Task Bar

Hiding App in Task Bar

I have no problem hiding my app from the task bar, but when I start a secondary
window from my app, the task bar button appears, and then remains in the task
bar. How can I stop this happening.

Thanks for any help.

Mark Bell
MSBell...@aol.com

 

Re:Hiding App in Task Bar


You must avoid setting the Visible property, and calling
MyForm.Show or MyForm.Hide.  TWinControl descendants will
cause the App's main icon to show up when you do that.

Call DisplayWindow below with any window you want to display.
If you are displaying your windows with API calls, then you
must also hide them with an API call, or things start to
go wrong.  Hiding is just one api call:

  ShowWindow(MyForm.Handle, SW_HIDE);

----------------------------------------

procedure DisplayWindow(W: TWinControl);

  procedure fDisplay(W: TWinControl);
  var i: integer;
  begin
  ShowWindow(W.Handle, SW_SHOW);
  for i:= 0 to pred(W.ControlCount) do
    if W.Controls[i] is TWinControl then
      fDisplay(TWinControl(W.Controls[i]));
  end;

begin
ShowWindow(W.Handle, SW_RESTORE);
fDisplay(W);
end;

----------------------------------------

It has to be done recursively since child windows
will not necessarily be displayed with ShowWindow.

Quote
MSBell457 wrote:

> I have no problem hiding my app from the task bar, but when I start a secondary
> window from my app, the task bar button appears, and then remains in the task
> bar. How can I stop this happening.

Re:Hiding App in Task Bar


On 1 Nov 1998 11:11:52 GMT, msbell...@aol.com (MSBell457) wrote:

Quote
>I have no problem hiding my app from the task bar, but when I start a secondary
>window from my app, the task bar button appears, and then remains in the task
>bar. How can I stop this happening.

Try this in the application startup code:

  SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);

--
Report all {*word*201} mail to your Potsmaster.

Re:Hiding App in Task Bar


Thanks for the tips.

Mark Bell

Other Threads