Solved

Maximize loses its smaller size...

Posted on 2004-04-30
3
191 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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 112
Separate into files by filename 12 91
has22 challenge 11 107
matchUp  challenge 6 77
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

733 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