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
Solved

Maximize loses its smaller size...

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 69
twoTwo  challenge 35 107
post4 challenge 28 104
zeroMAx challenge 20 111
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 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