Solved

Maximize loses its smaller size...

Posted on 2004-04-30
3
181 Views
Last Modified: 2013-11-20
I have an SDI application that saves it's main window's maximize state... When I start up the application, the window is resized to the maximize size and everybody is happily diddly!

The problem is that when I click on the maximize again to restore the size, well obviously it doesn't go back to the size it was when I closed the application. It just shrinks a little bit and sits there... kinda what happened the night the leafs lost last week...

Where can I find the window's restore size and how do I put it back when I show the window?

(The maximize is restored at the end of "InitInstance" of the main application class.)

-- Bubba
0
Comment
Question by:bganoush
3 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 10965973
You should keep last window size in non-maximized state. When window it closed in maximized state, keep in Registry this state and window size before it was maximized. When application starts, set this non-maximized size in PreCreateWindow and show window with SW_SHOWMAXIMIZED parameter. In this case window is able to return to it's normal state.
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 125 total points
ID: 10971686
Hi ,


with CWnd::GetWindowPlacement() you can retrieve a struct WINDOWPLACEMENT ... you can store this or it's members anywhere when the window closes.
After creation of the window you can re-set these stored state with CWnd::SetWindowPlacement()

ZOPPO


PS: Sorry, AlexFM, but it seems that we two are the only active experts here at this time answering questions ... it's nothing personal :o) I'm just pointing out alternatives ...
0
 

Author Comment

by:bganoush
ID: 10980921

Thanks Zoppo, that worked from the get go....

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now