Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Minimizing a window

Posted on 1999-07-22
11
Medium Priority
?
540 Views
Last Modified: 2013-11-20
I am using (modeless) CFormView windows, all with CMDIChildWnd frames.  Some of them have locked sizes.  Due to the sizes being locked I do not want them to be able to maximize (that just looks really weird).  In addition, if a maximized window calls one of these locked size windows, I want the locked size window to open restored (not maximized like Windows wants).  I have tried using ShowWindow(SW_RESTORE) from both the view and the frame.  It appears as if nothing happens when the command is processed.  When I try using SW_MINIMIZE in place of SW_RESTORE the window minimizes.  Why is it that SW_RESTORE doesn't work?  Am I using it in the wrong place?  Any suggestions or other recommendations?
Any help is much appreciated,

Jared
0
Comment
Question by:jaredg27
[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
11 Comments
 
LVL 4

Expert Comment

by:nil_dib
ID: 1311050
>> Am I using it in the wrong place?
Where did you use it?
0
 
LVL 2

Expert Comment

by:wyy_cq
ID: 1311051
CWnd has a member function
afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );

define this virtual function to provide the max_min info.
i think this is the best solution.


0
 

Expert Comment

by:vattal
ID: 1311052
Keep me updated
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:jaredg27
ID: 1311053
I wish that would work, but responding to WM_GETMINMAXINFO in the frame is how I got this problem!  I mean, I already have the window locked at a particular size there by setting the maximum and minimum dimensions.  I don't want the window to display maximized with those dimensions; it just looks really weird.  So I need to actually restore the window, not just choose a particular size.  Thanks for the help though : ).
0
 

Author Comment

by:jaredg27
ID: 1311054
>> Am I using it in the wrong place?
>Where did you use it?

I tried using it in both the view and the frame
>>I have tried using ShowWindow(SW_RESTORE)
>>from both the view and the frame.
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 1311055
What happens if you issue the ShowWindow(SW_RESTORE) twice in a row?
0
 

Author Comment

by:jaredg27
ID: 1311056
To Triskelion:
Absolutely nothing.
0
 

Expert Comment

by:jaguar_sri
ID: 1311057
USE MDIRESTORE FUNCTION INSIDE THE MDICHILDWND DERIVED CLASS
YOU SHOULD BE ABLE TO GET WHAT YOU WANT
0
 

Author Comment

by:jaredg27
ID: 1311058
Jaguar_sri:

It seems like you are definitely heading me in the right path.  Unfortunately, I could not get it to restore the window from the places I tried it (the view's OnSize and OnInitialUpdate).  (I used a pointer to the frame.)  The function works in other places (like responding to a button click).  Where would I want the function to reside so that the window could never be maximized (so that if it opened it always opens restored)?  Is there anything more I would need to handle that situation?
0
 
LVL 1

Accepted Solution

by:
speedup earned 180 total points
ID: 1311059
1. if you don't want your window to be maximized, use the ~WS_MAXMIZEBOX in CreateWindow.
2. try SW_SHOWNORMAL instead of SW_RESTORE

regards
0
 

Author Comment

by:jaredg27
ID: 1311060
Thank you.  ~WS_MAXMIZEBOX was one thing I needed.  What I also realized this morning was that I merely had to restore the window that was calling the child window before i opened it.  That easily worked.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

670 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