I tried using the information here in my existing dialog, but it didn't work, so I tried making a blank new project dialog box, and it still doesn't work.
What am I doing wrong? I followed the instructions.
Here is the blank dialog box, with the above code used.
The user can shrink / resize a frame window to practically show nothing, hiding controls, toolbars, menus, grids and even inner dialogs.
To prevent this, the minimum size can be specified for the frame.
1) add point member variable
2) add getminmaxinfo message handler function, declaration and definition
3) initialize the minimum point member variable in the constructor, the number has to be adjusted according to the size you want to appear(test).
////class
class CMainWnd : public CFrameWnd
{
...
POINTptDontLetItGetSmallerThanThis;
...
DECLARE_MESSAGE_MAP()
// Generated message map functions
//{{AFX_MSG(CMainWnd)
....
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
//}}AFX_MSG
....
}
/////constructor
CMainWnd::CMainWnd(...)
{
...
ptDontLetItGetSmallerThanThis.x=675;//width
ptDontLetItGetSmallerThanThis.y=500;//height
.....
}
////set the minimum
void CMainWnd::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
lpMMI->ptMinTrackSize =
ptDontLetItGetSmallerThanThis;
}
What am I doing wrong? I followed the instructions.
Here is the blank dialog box, with the above code used.