MDIForm, Windows Taskbar and GetWindowLong
Posted on 2008-06-10
I have an MDI Parent form that I wish to disable the Maximize button on. I can do this sucessfully with GetWindowLong, SetWindowLong with no problems as below.
Dim lngStyle As Long
lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) 'Disables Maximize Button
lngStyle= SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
However once I do this, the bottom part of my MDI parent form is drawn UNDER the Windows taskbar. The MDI form has not been redrawn to fit in the Windows destop area above the Taskbar rather it looks like it has been resized to the available screen area with the Taskbar drawn over it on the bottom of the screen.
I would like to have the MDIParent form redrawn to the desktop area above the Taskbar so the whole form can be seen.
Can't figure out how to do it - over to you experts.
Thanks in advance