Board index » cppbuilder » Need to hide exe's taskbar icon

Need to hide exe's taskbar icon

I'm trying to hide Win95/98 exe's taskbar icon. The info in the C++ Builder
How To book doesn't seem to work.

Thanks in advance,

Kevin.Be...@Vitrex.com

 

Re:Need to hide exe's taskbar icon


Quote
Kevin Berry <Kevin.Be...@vitrex.com> wrote:
>I'm trying to hide Win95/98 exe's taskbar icon. The info in the C++ Builder
>How To book doesn't seem to work.

Are you using BCB3? This is the code I use:

// StopAppWindowFromAppearingOnTaskbar
// We do this by ensuring that its handle as the WS_EX_TOOLWINDOW style and
// not WS_EX_APPWINDOW.
// BCB3's behaviour is different from BCB1. BCB1 presumptorily tried to
// make the app visible straight away. BCB3 only does when one of the forms
// becomes visible. As long as you call this routine before any forms
// become visible, then it will work.
// A good time would be at the start of your WinMain
void __fastcall PACKAGE StopAppWindowFromAppearingOnTaskbar()
{ HWND hwnd=Application->Handle;
  LONG wsx=GetWindowLong(hwnd,GWL_EXSTYLE);
  wsx=(wsx & !WS_EX_APPWINDOW) | WS_EX_TOOLWINDOW;
  SetWindowLong(hwnd,GWL_EXSTYLE,wsx);

Quote
}

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. ljw1...@cam.ac.uk

Re:Need to hide exe's taskbar icon


Lucian, you're a genius (but I'm sure you already know this!).

Thank you very much. Your solution worked easily and perfectly the first
time.

Kevin Berry

Other Threads