?
Solved

Maximize loses its smaller size...

Posted on 2004-04-30
3
Medium Priority
?
202 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 500 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

770 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