Solved

Maximize loses its smaller size...

Posted on 2004-04-30
3
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 31

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

717 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