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?
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?