diff --git a/ChangeLog b/ChangeLog index be46f28..716f7b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-24 Eric Wasylishen + + * Source/win32/WIN32Server.m (-setmaxsize::): + Remove the maximize box when a maximum size is set on a window. + 2010-08-10 Fred Kiefer * Source/cairo/CairoFontEnumerator.m, diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index ee97d8e..55fdff9 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -1384,6 +1384,18 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, p.x = size.width; p.y = size.height; win->minmax.ptMaxTrackSize = p; + + // Disable the maximize box if a maximum size is set + if (size.width < 10000 || size.height < 10000) + { + SetWindowLong((HWND)winNum, GWL_STYLE, + GetWindowLong((HWND)winNum, GWL_STYLE) ^ WS_MAXIMIZEBOX); + } + else + { + SetWindowLong((HWND)winNum, GWL_STYLE, + GetWindowLong((HWND)winNum, GWL_STYLE) | WS_MAXIMIZEBOX); + } } /** Set the minimum size of the window */