Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically setting taskbar icon on and off

Status
Not open for further replies.

Sen7inel

IS-IT--Management
Feb 14, 2001
90
FI
I'm making an MFC app that consists of only one dialog. I'm trying to make it so that when the dialog is minimized, that taskbar icon would disappear and a tray icon would appear. Again, when tray icon is doubleclicked, the tray icon would disappear and taskbar icon would appear.

I use OnActivate handler to check out when the dialog is being minimized. I then create the tray icon, add it to tray and remove style WS_EX_APPWINDOW. On tray icon doubleclick, I delete the tray icon, add the application window -style and try to show the window.

The problem here is, that for the taskbar icon to disappear I need to refresh the window using ShowWindow with various SWs. Of course this sort of makes the framework call OnActivate FROM OnActivate. I thought I'd use some sort of member variable to set a status which would determine when the style should be modified etc, but to me this seems like a real dumb solution.

Is there any other way to either refresh the Window styles without getting a call to OnActivate, or receive info when the window is being minimized, again NOT from OnActivate?
 
It seems that by making the window an application window and then sending SW_HIDE to it made the taskbar icon go away.. Duh.

Anyway, I still wonder which show commands create calls to OnActivate?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top