Hiding task bar icon correctly

Jon Glazer wrote:

> Ok, I've been using the following in my project source for a while:

>   SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);

> The problem with this is that Windows does not seem to recognize my main form
> as a normal window.  Hence, when I right click on the task bar and select
> "minimize all windows", my form stays on the screen.  In fact, if mine is the
> only form up, "minimize all windows" is not even available.

> I would like to know, if possible, how to put the icon back on demand then
> take it away so that I can put it back when I activate my form, then take it
> away when I hide it, this way the minimize all windows command will work
> properly.

I suppose

    DefaultExStyle: LongInt;

  DefaultExStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
  SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);

is just too obvious?


Personal Pages              http://www.midnightbeach.com/jon
Programming Publications    http://www.midnightbeach.com/jon/pubs
Homeschool Resource Page    http://www.midnightbeach.com/hs