Log in

View Full Version : Taskbar


Tech19
April 16th, 2002, 17:11
Hey I was wondering how I could go about hiding a programs name/icon in the windows taskbar. I've never done anything like this before so any help would be appreciated, thanks.

ZaiRoN
April 16th, 2002, 17:21
hi Tech19,

try to use CreateWindowEx.
setting dwExStyle as WS_EX_TOOLWINDOW should work.

bye
ZaiRoN

notbob
April 16th, 2002, 18:34
Quote:
Originally posted by Tech19
Hey I was wondering how I could go about hiding a programs name/icon in the windows taskbar. I've never done anything like this before so any help would be appreciated, thanks.


The taskbar only lists top-level windows that are currently being shown. That is, it displays windows that have both a NULL hWndParent handle and haven't been hidden with a call to ShowWindow(hWnd, SW_HIDE).

A very simple way to keep a window off the taskbar is to create a hidden top-level window and only use it as a parent proxy for your real top-level window.

Below is a code snip modified from the standard MSVC6 Windows Application AppWizard

Good luck,
-notbob

Code:

BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd, hParentWnd;

/* Create our hidden top-level window */
hParentWnd = CreateWindow(szProxyWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

/* Create our visible window as a child of the hidden top-level window */
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, hParentWnd, NULL, hInstance, NULL);

/* Display the child window, but NOT the top-level one */
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;
}