CDialog::Create() changes foreground window
Hi
In my dialog based application I must create a modeless, invisible
window:
class CDummyDlg :
public CDialog
{
// (...)
};
BOOL
CApp::InitInstance()
{
// (...)
InitCommonControls();
this->TBase::InitInstance();
CDummyDlg * m_dummy_dlg;
this->m_dummy_dlg = new CDummyDlg();
this->m_dummy_dlg->Create(IDD);
this->m_pMainWnd = this->m_dummy_dlg;
// (...)
}
Unfortunately the CDialog::Create() method somehow changes the
foreground window from, for example: Total Commander or MS Visual
Studio, or any other program, starting my application, into ....
nothingness - after finishing the Create method there is no Foreground
window in the system. I don't want it to happen till I actually show my
window, which happens after I hit the PrintScreen key, and fire an
event.
The IDD resource does not have the visibility flag set to on. Here is
the complete dialog definition from resource file:
IDD DIALOGEX 0, 0, 323, 201
STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND |
DS_FIXEDSYS | WS_CAPTION
EXSTYLE WS_EX_PALETTEWINDOW
CAPTION "SCC"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
END
How can I prevent the Create() method from changing the foreground
window?
Btw - I cannot delay the creation of this window.
Any help would be appreciated.
Thanks in advance