CDialog + minimum size

Can I set minimum size of dialog window?

WM_GETMINMAXINFO not work
LVL 9
cdesignerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

captainkirkCommented:
Override CDialog::PreCreateWindow() and set the size of the dialog:

cs.cx = nTheWidthYouWant;
cs.cy = nTheHeightYouWant;
0
cdesignerAuthor Commented:
No!
If i resizedeialog with mouse? I need not start size, I need absolutly minimal size for window
0
chensuCommented:
WM_GETMINMAXINFO should work. Show your code please.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

basantCommented:
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
bhatCommented:
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
cdesignerAuthor Commented:
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
bhatCommented:
Can U clearly state the question.
0
cdesignerAuthor Commented:
What? sorry not understand
0
chensuCommented:
Do you have ON_WM_GETMINMAXINFO in your message map?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
basantCommented:
No reply of my comments.

{
Hey bhat r u Rohit Bhat from SISL.
}
0
cdesignerAuthor Commented:
Oh , you right, CDialog not have this mesage in message map. you cool ! ;)
thanks
0
bhatCommented:
I am Vighnaraj Bhat
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.