Tray Icon and restoring to maximized position |
Post Reply |
Author | |
mitcheljh
Groupie Joined: 20 July 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
Posted: 16 July 2009 at 11:41am |
I'm encountering an odd situation with my application with the tray icon. It seems that the when I restore the app from the tray icon which was minimized from a maximized position, the application is restored to the window position BEFORE the application was maximized, not the maximized position. I can never restore the application (from the tray icon) to a maximized state.
The Demo application TrayIconDemo doesn't have this problem, so it's something unique to my application. I've traced through CXTTrayIcon::MinimizeToTray() and CXTTrayIcon::MaximizeFromTray(). In MinimizeToTray(), the rectangle rectFrom, returned from GetWindowRect() has the correct dimensions of my maximized application. But, when restoring from the tray icon, in MaximizeFromTray(), GetWindowRect() returns a rectangle of the dimensions that my application was in BEFORE I maximized it, not the maximized dimensions. It seems like it could be an issue that windows is not saving the dimensions of my maximized window. But when I minimize and maximize without using the tray icon, this problem doesn't occur. I checked my application and I can't find anywhere that I'm manually setting the windows position that would cause this issue. Thanks |
|
mitcheljh
Groupie Joined: 20 July 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
|
Sorry for posting my question prematurely.
I just discovered the problem. I needed to derive a new class from CXTTrayIcon, and override CreateMinimizedWnd() to do nothing but return true, as in the demo application. After doing this, the application window is now minimizing from, and maximizing to, a fully maximized window properly. Thanks. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |