>>I have a form class for which I've set MaxWidth and MaxHeight. When I click the maximize button in the form, it properly maximizes to the size I've specified.
>>However, the form runs inside a top-level window. If the top-level window is minimized and then restored while my form is maximized, when it reappears, my form now fills the top-level window, ignoring MaxWidth and MaxHeight. The same thing happens if I maximize the top-level window while my form is maximized.
>>Anybody run into this? Have any ideas how to prevent it?
>>Tamar
>
>On windows where I've needed a hard size I've used a DLL to subclass the window, intercepting and altering the WM_SIZING message that is sent continually as the user resizes a window, which allows the program to alter the size and affix it to a maximum or minimum). I have invoked this as some startup code in Init() which registers the thisForm.hwnd, and the min and max widths and heights.
>
>
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632646%28v=vs.85%29.aspxTurns out I didn't need a DLL or BindEvent(), just code in Resize that catches any attempt to go beyond my specified maxes and reset.
Tamar