Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Dialog Min size

Status
Not open for further replies.

ForeverCode

Programmer
Dec 6, 2002
41
0
0
US
How would I set a CDialog's minimum size so the users cannot resize smaller than the min?
 
Thanx, I'm using that, but I thought there was some API that would automatically stop the user from sizing the app when it hits a certain size.
 
There aint.

/Per
[sub]
if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
[/sub]
 
Actually WM_GETMINMAXINFO:

void CInstantMessage::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
CDialog::OnGetMinMaxInfo(lpMMI);

RECT winrect;
GetDesktopWindow()->GetClientRect(&winrect);
lpMMI->ptReserved = CPoint(0,0);
lpMMI->ptMaxSize = CPoint(winrect.right,winrect.bottom);
lpMMI->ptMaxPosition = CPoint(0,0);
lpMMI->ptMaxTrackSize = CPoint(winrect.right,winrect.bottom);
lpMMI->ptMinTrackSize = CPoint(235,250);
}

That seems to prevent the user from sizing it smaller than (235,250)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top