Detect window state (maximized or restored)
-
Im working in a dialog based MFC application in visual studio. And i need some way to check to see if the main window is maximized, filling the whole screen or restored, like a normal window. Is there some way i can like a if (Window.Restored == 1) etc? P.S. Im used to working in visual studio 6.0, but sometimes i work in .NET 2003, when in .NET 2003 how do i like open the wizard thingy, where i can like add events (like PreTranslateMessage etc) thanks!!
//Johannes
-
Im working in a dialog based MFC application in visual studio. And i need some way to check to see if the main window is maximized, filling the whole screen or restored, like a normal window. Is there some way i can like a if (Window.Restored == 1) etc? P.S. Im used to working in visual studio 6.0, but sometimes i work in .NET 2003, when in .NET 2003 how do i like open the wizard thingy, where i can like add events (like PreTranslateMessage etc) thanks!!
//Johannes
if (IsIconic(hwnd)) { // window is minimized } else if (IsZoomed(hwnd)) { // window is maximized } else { // window is restored (neither minimized nor maximized) }
Best wishes, Hans
[CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]
-
Im working in a dialog based MFC application in visual studio. And i need some way to check to see if the main window is maximized, filling the whole screen or restored, like a normal window. Is there some way i can like a if (Window.Restored == 1) etc? P.S. Im used to working in visual studio 6.0, but sometimes i work in .NET 2003, when in .NET 2003 how do i like open the wizard thingy, where i can like add events (like PreTranslateMessage etc) thanks!!
//Johannes
Try using
BOOL GetWindowPlacement( HWND hWnd, // handle to window WINDOWPLACEMENT *lpwndpl // position data );
. Regards, Paresh. -
Im working in a dialog based MFC application in visual studio. And i need some way to check to see if the main window is maximized, filling the whole screen or restored, like a normal window. Is there some way i can like a if (Window.Restored == 1) etc? P.S. Im used to working in visual studio 6.0, but sometimes i work in .NET 2003, when in .NET 2003 how do i like open the wizard thingy, where i can like add events (like PreTranslateMessage etc) thanks!!
//Johannes