Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Fixed position/size windows in an MDI application

Hello guys,
I am working on a project in which I have an MDI application in which I want to divide the main frame into 4 quarters, each of which displaying an independent document (window). I need to make every one of the 4 displayed documents fixed in its position and non resizable. Does anybody have any hints about fixing the size and position of every window? Thank you in advance.
[390 byte] By [Hanady] at [2007-11-11 10:14:28]
# 1 Re: Fixed position/size windows in an MDI application
You should process WM_WINDOWPOSCHANGING message. Basically you write a single handler for this message to process each window of your MDI application. LParam parameter of the above message points to a WINDOWPOS structure, one member of which is called flags (UINT flags).

if you write something like this in your message handler:
WINDOWPOS *ws = (WINDOWPOS*)msg.lParam; //msg is the message
ws->flags &= SWP_NOMOVE; //retains the current position
ws->flags &= SWP_NOSIZE; // retains the current size
Ivan** at 2007-11-11 20:59:18 >
# 2 Re: Fixed position/size windows in an MDI application
Thanks a million, Ivan. I will follow this procedure right now. Thanks again.
Hanady at 2007-11-11 21:00:18 >