Board index » delphi » Self.Hide in main form doesn't hide app from taskbar.

Self.Hide in main form doesn't hide app from taskbar.


2003-10-30 10:41:56 PM
delphi127
In my application's main form, i call
Self.Hide
The form disappears, but stay on the taskbar.
Can anyone think of any reason why that would happen?
i've traced through the VCL source, and nothing looks out of the oridinary.
What makes the app disappear from the taskbar?
 
 

Re:Self.Hide in main form doesn't hide app from taskbar.

"Ian Boyd" <XXXX@XXXXX.COM>writes:
Quote
In my application's main form, i call
Self.Hide

The form disappears, but stay on the taskbar.

Can anyone think of any reason why that would happen?

i've traced through the VCL source, and nothing looks out of the oridinary.


What makes the app disappear from the taskbar?
You didn't ask Windows to exclude you. Try adding this code:
{ Tell Windows to exclude us from the taskbar and task switch window }
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE)
or WS_EX_TOOLWINDOW);
Good luck.
Kurt
 

Re:Self.Hide in main form doesn't hide app from taskbar.

i gave up, and just call
ShowWindow(Application.Handle, SW_HIDE);
and
ShowWindow(Application.Handle, SW_SHOW);
when i want to show it again.
"Kurt Barthelmess (TeamB)" <XXXX@XXXXX.COM>writes
Quote
"Ian Boyd" <XXXX@XXXXX.COM>writes:

>In my application's main form, i call
>Self.Hide
>
>The form disappears, but stay on the taskbar.
>
>Can anyone think of any reason why that would happen?
>
>i've traced through the VCL source, and nothing looks out of the
oridinary.
>
>
>What makes the app disappear from the taskbar?

You didn't ask Windows to exclude you. Try adding this code:

{ Tell Windows to exclude us from the taskbar and task switch window }
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE)
or WS_EX_TOOLWINDOW);

Good luck.

Kurt