From: David Ching on
"jc" <jc(a)discussions.microsoft.com> wrote in message
news:B1291FC5-3F6E-44E0-8A43-5D5B34A70899(a)microsoft.com...
> But, the task bar icon is always visible. even when the icon is in the
> System Tray.
>
> How do we hide and show the taskbar icon?
>

Set the WS_EX_TOOLWINDOW style.

-- David


From: jc on
Hello David,

Thank you for taking the time to reply to my posting.

Yes, setting the window style to WS_EX_TOOLWINDOW
removed the taskbar icon; however, we can dynamically
restore the taskbar icon (when the window opens).

hide:
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);

show:
ModifyStyleEx(WS_EX_APPWINDOW, ~WS_EX_TOOLWINDOW);

How can we dynamically hide/show the taskbar icon?

TIA,
-jc
From: David Ching on
"jc" <jc(a)discussions.microsoft.com> wrote in message
news:2E32E090-BF9E-4DBB-BA20-53568C396E7A(a)microsoft.com...
> Hello David,
>
> Thank you for taking the time to reply to my posting.
>
> Yes, setting the window style to WS_EX_TOOLWINDOW
> removed the taskbar icon; however, we can dynamically
> restore the taskbar icon (when the window opens).
>
> hide:
> ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
>
> show:
> ModifyStyleEx(WS_EX_APPWINDOW, ~WS_EX_TOOLWINDOW);
>
> How can we dynamically hide/show the taskbar icon?
>
> TIA,
> -jc

Sorry, I don't understand. You say ModifyStyleEx() allows you to
dynamically hide and show the taskbar icon, yet you ask how to do that?
Does ModifyStyleEx() work or not?

Thanks,
David

From: Tom Serface on
You could try PJ's class CSystemTray. It has a HideIcon() function that
makes this really easy.

http://www.naughter.com/ntray.html

Or if you want to do it yourself you can make a call to Shell_NotifyIcon:

http://msdn.microsoft.com/en-us/library/bb762159(VS.85).aspx

Tom

"jc" <jc(a)discussions.microsoft.com> wrote in message
news:2E32E090-BF9E-4DBB-BA20-53568C396E7A(a)microsoft.com...
> Hello David,
>
> Thank you for taking the time to reply to my posting.
>
> Yes, setting the window style to WS_EX_TOOLWINDOW
> removed the taskbar icon; however, we can dynamically
> restore the taskbar icon (when the window opens).
>
> hide:
> ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
>
> show:
> ModifyStyleEx(WS_EX_APPWINDOW, ~WS_EX_TOOLWINDOW);
>
> How can we dynamically hide/show the taskbar icon?
>
> TIA,
> -jc