*CtrlCore: Fixed issue with large layout (too big for screen) and WM_GETMINMAXINFO

git-svn-id: svn://ultimatepp.org/upp/trunk@3395 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-05-02 11:42:50 +00:00
parent 075fa2cdf7
commit 14fcde26fd
2 changed files with 8 additions and 3 deletions

View file

@ -440,8 +440,12 @@ LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
case WM_GETMINMAXINFO:
{
MINMAXINFO *mmi = (MINMAXINFO *)lParam;
Rect minr(Point(50, 50), GetMinSize());
Rect maxr(Point(50, 50), GetMaxSize());
Rect frmrc = Size(200, 200);
::AdjustWindowRect(frmrc, WS_OVERLAPPEDWINDOW, FALSE);
Size msz = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top,
frmrc.right - 200, frmrc.bottom - 200).GetSize();
Rect minr(Point(50, 50), min(msz, GetMinSize()));
Rect maxr(Point(50, 50), min(msz, GetMaxSize()));
dword style = ::GetWindowLong(hwnd, GWL_STYLE);
dword exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
AdjustWindowRectEx(minr, style, FALSE, exstyle);