Board index » delphi » Hide application from taskbar.

Hide application from taskbar.

  How can I remove my application from taskbar without closing it in
Delphi 3 !

Thanks for your help !

 

Re:Hide application from taskbar.


Quote
John Mc Kimsley wrote:

>   How can I remove my application from taskbar without closing it in
> Delphi 3 !

> Thanks for your help !

ShowWindow(Application.Handle,SW_HIDE)

ShowWindow is the Windows API function. You can also try with
SetWindowPos.

Each Delphi app has an invisible window which handle can be found
retrieve with Application.Handle. This handle can be used with all the
API functions that uses a HWnd parameter.

Take a look at online help about Application object.

Regards,

Frdric GUILLIEN

Re:Hide application from taskbar.


To hide an app from the taskbar, I use this:

  showwindow(application.handle, sw_hide);

To make it re-appear, I use:

  showwindow(application.handle, sw_showdefault);

Hope this helps,
Eric...

Quote
John Mc Kimsley wrote in message <34E98FF3.CBE06...@easynet.fr>...
>  How can I remove my application from taskbar without closing it in
>Delphi 3 !

>Thanks for your help !

Re:Hide application from taskbar.


Quote
>  How can I remove my application from taskbar without closing it in
>Delphi 3 !

The only way that I know works perfectly also makes it so you can't ALT-TAB
to the program, even though the window is showing.  Here's how:

procedure Tform1.HideTaskButton;
begin
ShowWindow( Application.Handle, SW_HIDE );
SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                 WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
ShowWindow( Application.Handle, SW_SHOW );
End;

Then, put a call to HideTaskButton in the ONCREATE handler for your form.

If you want to be able to alt-tab to your program, try the TNoTask
component, available at www.sunsite.icm.edu.pl/delphi

Eric Lawrence
Applications Architect
Bayden Systems
delta...@wam.umd.edu
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Other Threads