Woody Howru
unread,Mar 29, 2012, 7:23:43 PM3/29/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
A class based on CWnd is my main window. From this, it is possible, by clicking on various parts, to start MFC dialogs. At this time, I want the MFC dialog to be visible, the main window to be invisible, and the icon from my main window to remain in the task bar. I cannot seem to accomplish these all at once.
Typical code for starting the MFC dialog is
CMyMFCDialog *pDlg=new CMyMFCDialog;
pDlg->DoModal();
delete pDlg;
If I precede this with ShowWindow(SW_HIDE) in the main window class, the main window vanishes, and so does the task bar icon.
If instead I use ShowWindow(SW_MINIMIZE), the task bar icon remains, as wanted, but the modal dialog is not visible.
I can't use pDlg->ShowWindow in the main window class, because the dialog window has not yet been created.
Even if I put ShowWindow(SW_SHOW) (or SW_NORMAL) in the OnInitDlg handler in CMyMFCDialog, the dialog remains invisible. It can only be made visible by toggling the task bar icon.