Posted on 2006-10-27
I have obtained the following code for creating a sub dialog on a main dialog. Basically, I have a combo box on the main dialog that determines which child dialog to display on the main dialog. The child dialog is created and positioned to be within an area defined by a picture control on the main dialog. Have a look at this:
pNewDialog->Create( this );
pNewDialog->SetWindowPos(&m_wndSubDialogArea, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOACTIVATE | SWP_NOSENDCHANGING);
Assume that pNewDialog is a CDialog derived class, and m_wndSubDialogArea is the picture control where the sub dialog sits.
OK then. Having looked at this code, I am not sure on what the first parameter of SetWindowPos is doing exactly. I have read the docs, and it talks about Z order. Is this the Z order that is iterated through when we press Alt-Tab ?
Now then. I changed this parameter from my picture control to
and instead of the child dialog being fit nicely into my picture control, it appeared with its top left corner in the main dialog's top left corner.
I experimented with other values: wndBottom works fine, wndTop works but I can still see the outline of my picture control (black), and wndNoTopMost does the same as wndTopMost.
Can someone please explain these results ?
I need to understand this as I have a second question which can be answered when this first one has.