?
Solved

CDialog + minimum size

Posted on 1999-12-03
12
Medium Priority
?
728 Views
Last Modified: 2013-11-20
Can I set minimum size of dialog window?

WM_GETMINMAXINFO not work
0
Comment
Question by:cdesigner
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 4

Expert Comment

by:captainkirk
ID: 2253588
Override CDialog::PreCreateWindow() and set the size of the dialog:

cs.cx = nTheWidthYouWant;
cs.cy = nTheHeightYouWant;
0
 
LVL 9

Author Comment

by:cdesigner
ID: 2254145
No!
If i resizedeialog with mouse? I need not start size, I need absolutly minimal size for window
0
 
LVL 23

Expert Comment

by:chensu
ID: 2254155
WM_GETMINMAXINFO should work. Show your code please.
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
LVL 2

Expert Comment

by:basant
ID: 2254302
I didn't get
what do you mean by
>minimum size of dialog window?

You can resize a window
using :
(1) SetWindowPos with SWP_SIZE

(2) MoveWindow Call

Use these in OnInitDialog.
0
 
LVL 1

Expert Comment

by:bhat
ID: 2254639
Hi There

Use of MinMaxInfo is workin for me.
This is how I have done it.

Use two variales nMinWidth & nMinHeight. Initialize them to 0 in the constructor.

In the oncreate of your dialog box set the values to nMinWidth
& nMinHeight
In OnCreate(........)
{
      if (CDialog::OnCreate(lpCreateStruct) == -1)
            return -1;
      m_minWidth  = lpCreateStruct->cx ;
      m_minHeight = lpCreateStruct->cy ;
}

in OnGetMinMaxInfo(......) function
{
if (!m_minWidth) // first time
{
   CDialog::OnGetMinMaxInfo(lpMMI);
   return;
}
    lpMMI->ptMinTrackSize.x = m_minWidth;
    lpMMI->ptMinTrackSize.y = m_minHeight;
}

This sets the minimum height & width below which you cannot resize
0
 
LVL 9

Author Comment

by:cdesigner
ID: 2254657
No work

OnGetMaxMinInfo - protected function in
CDialog and it not called anytime.

Once more:
I create Dialog window, And want to set
minimum size this windows - window can
resizing more but no less.
0
 
LVL 1

Expert Comment

by:bhat
ID: 2254677
Can U clearly state the question.
0
 
LVL 9

Author Comment

by:cdesigner
ID: 2254685
What? sorry not understand
0
 
LVL 23

Accepted Solution

by:
chensu earned 160 total points
ID: 2255172
Do you have ON_WM_GETMINMAXINFO in your message map?
0
 
LVL 2

Expert Comment

by:basant
ID: 2255679
No reply of my comments.

{
Hey bhat r u Rohit Bhat from SISL.
}
0
 
LVL 9

Author Comment

by:cdesigner
ID: 2256412
Oh , you right, CDialog not have this mesage in message map. you cool ! ;)
thanks
0
 
LVL 1

Expert Comment

by:bhat
ID: 2257499
I am Vighnaraj Bhat
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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: 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…
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.
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…

601 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