|
-
February 5th, 2004, 09:08 AM
#1
Is a minimized Window maximized or normal?
Hi
I'm looking for a generic solution to determine whether a currently minimized window will be restored to its normal position or will be restored maximized.
GetWindowPlacement ShowCmd always returns SW_SHOWMINIMIZED.
I want to prevent the need to handle WM_SYSCOMMAND commands SC_MINIMIZE, SC_RESTORE and SC_MAXIMIZE and save the last state on every change.
Thanks for your ideas!
Oliver.
Last edited by Oliver Twesten; February 5th, 2004 at 10:08 AM.
-
February 5th, 2004, 09:15 AM
#2
-
February 5th, 2004, 10:08 AM
#3
Originally posted by marsh_pottaye
Try GetWindowPlacement
may I quote myself...
Originally posted by Oliver Twesten
GetWindowPlacement ShowCmd always returns SW_SHOWMINIMIZED.
But thanks anyway.
-
February 5th, 2004, 10:50 AM
#4
Re: Is a minimized Window maximized or normal?
Originally posted by Oliver Twesten
I want to prevent the need to handle WM_SYSCOMMAND commands SC_MINIMIZE, SC_RESTORE and SC_MAXIMIZE and save the last state on every change.
Handling the system commands won't help anyway, as the window state may have changed by other means (e.g. programmatically). However, you could handle WM_SIZE and save the nType value to a member variable. When the window is minimized (nType == SIZE_MINIMIZED), you take the last saved state and remember it in a second variable - that's your previous state.
-
February 5th, 2004, 12:33 PM
#5
Re: Re: Is a minimized Window maximized or normal?
Hi gstercken
Thanks for this idea. You're right that handling of SC_MAXIMIZE etc. is no good way to go - it is most obvious when maximizing the window by double-clicking on the title area instead of clicking the maximize button...
In the meantime, I used a similar approach than yours, but I'm still not satisfied (although it works). I'm looking for a way to save the state of a window *without* handling any messages for that window.
I can not believe this could be so "complicated". Every simple framewnd app should store the window position including maximization state independent of whether it is terminated in minimized state or not.
I thought this state had to be stored in the window object, but it does not seem to?
Oliver.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|