win32
asked on
Overloading onSize
Hi
I wanna overload onsize, but not realy sure how to do it. Problem: My application is resizeable... but the application should not be smaler then 400 * 400.
OnSize(..)
{
//When new size is smaler then 500 * 500 pixels.. don't resize
}
But, how is that done ?
CB
I wanna overload onsize, but not realy sure how to do it. Problem: My application is resizeable... but the application should not be smaler then 400 * 400.
OnSize(..)
{
//When new size is smaler then 500 * 500 pixels.. don't resize
}
But, how is that done ?
CB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have doen like this:
void CChildView::OnGetMinMaxInf o( MINMAXINFO FAR* lpMMI )
{
POINT pMin;
pMin.x = 100;
pMin.y = 100;
lpMMI->ptMinTrackSize = pMin;
CWnd::OnGetMinMaxInfo(lpMM I);
}
But it does not work ???
void CChildView::OnGetMinMaxInf
{
POINT pMin;
pMin.x = 100;
pMin.y = 100;
lpMMI->ptMinTrackSize = pMin;
CWnd::OnGetMinMaxInfo(lpMM
}
But it does not work ???
Thought you wanted it to be 400 * 400 or 500 * 500???
Also, looks like you want to make sure a child frame in an MDI app is what you want to restrict, correct??
Also, looks like you want to make sure a child frame in an MDI app is what you want to restrict, correct??
And, maybe you should modify the values after you called CWnd::OnGetMinMaxInfo()
coz maybe there the values are modified again...
coz maybe there the values are modified again...
ASKER
Hmm I made a mistake, I was modifying a child wnd to the main wnd.. now it works :-)
:(
I'm not happy about this because you simply accepted captainkirk's comment as answer
without telling a reason what's wrong with my comment.
I'm not happy about this because you simply accepted captainkirk's comment as answer
without telling a reason what's wrong with my comment.
zoppo - I'd like to give you the points 'cuz you were the one who made the correct suggestion first -- look for a Q in the MFC section.... see ya later...
to avoid flickering it's better to restrict window-sizes by handling the WM_GETMINMAXINFO
message. Override CWnd::OnGetMinMaxInfo() for your window's class and in there simply
set the ptMinTrackSize member of the passed MINMAXINFO to 500, 500.
hope that helps,
ZOPPO