Detecting a Maximized Window or How do I save my Window State? 
Author Message
 Detecting a Maximized Window or How do I save my Window State?

I'm adding some code to save a window's state (zoomed or not zoomed),
extent and position. I can't seem to find if a Window is zoomed or not.
Is there a way? The other two pieces of data are easy to locate.

Or should I just serialized the view / presenter / model and just use
that instead? :P



Mon, 07 Feb 2005 18:56:08 GMT  
 Detecting a Maximized Window or How do I save my Window State?

Quote:
> I'm adding some code to save a window's state (zoomed or not zoomed),
> extent and position. I can't seem to find if a Window is zoomed or not.
> Is there a way? The other two pieces of data are easy to locate.

> Or should I just serialized the view / presenter / model and just use
> that instead? :P

I assume you are trying to do this to save the information to the registry
(etc), since the MVP system will do this automatically for windows saved in
the image, or into resources, the latter being just the serialized
representation of the view.

You can detect if a Window is zoomed or not using the IsZoomed() Win32
call - this is wrapped as UserLibrary>>isZoomed:, but there is no
convenience wrapper for it in the View class. Alternatively you could just
use View>>placement[:]. This uses the Get/SetWindowPlacement() API calls in
conjunction with a WINDOWPLACEMENT structure, that records all of the
details about the views position and size, including whether it is
maximized, minimized, etc. In fact it is this which is used by the MVP
system to save/restore the placement of windows.

Regards

Blair



Sat, 12 Feb 2005 17:03:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. wm state and maximizing a window

2. Newbie unable to kill window after Maximizing window.

3. Window Handle / Maximize dos window ???

4. maximizing windows in motif and windows

5. On Windows, don't use a maximize box if the Windows is not resizable

6. saving and loading a text window with embedded windows

7. Code to maximize console window?

8. Code to maximize console window?

9. maximizing a window?

10. Maximizing a windows (under WindowsNT)

11. How to get rid of maximize button in Windows

12. Maximizing a window on open with VW

 

 
Powered by phpBB® Forum Software