使用:WM_GETMINMAXINFO message
1 void OnGetMinMaxInfo(MINMAXINFO* lpMMI) 2 { 3 lpMMI->ptMinTrackSize.x = 400; 4 lpMMI->ptMinTrackSize.y = 400; 5 lpMMI->ptMaxTrackSize.x = 400; 6 lpMMI->ptMaxTrackSize.y = 400; 7 }
上述方法就限制了窗口的大小为长400,高400。