Hiding MFC Dialog based applications
-
Hi, I'm trying to write a small application (www.aspestrand.com) that sits in the system tray and is hidden on start up. I've tried a lot of different things like setting the style before creation to be not visible, etc... but the best i can get is the dialog flashing on the screen once before it gets the message to hide which i post OnInitDialog() BOOL CReminderDlg::OnInitDialog() { CMenuDlg::OnInitDialog(); // some initialization .......................... // hide window PostMessage(WM_COMMAND, IDC_HIDE); // other initialization .......................... return TRUE; } void CReminderDlg::OnHide() { ShowWindow(SW_HIDE); } Is there a way to have the dialog not show unless i call ShowWindow(SW_NORMAL) on it? The dialog is set up never to show up on the task bar. thanks Bryn Aspestrand
-
Hi, I'm trying to write a small application (www.aspestrand.com) that sits in the system tray and is hidden on start up. I've tried a lot of different things like setting the style before creation to be not visible, etc... but the best i can get is the dialog flashing on the screen once before it gets the message to hide which i post OnInitDialog() BOOL CReminderDlg::OnInitDialog() { CMenuDlg::OnInitDialog(); // some initialization .......................... // hide window PostMessage(WM_COMMAND, IDC_HIDE); // other initialization .......................... return TRUE; } void CReminderDlg::OnHide() { ShowWindow(SW_HIDE); } Is there a way to have the dialog not show unless i call ShowWindow(SW_NORMAL) on it? The dialog is set up never to show up on the task bar. thanks Bryn Aspestrand
The dialog cannot be shown, unless it's created. Didn't you forget to remove
CReminderDlg::DoModal()
fromInitInstance
code? Robert-Antonio "I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:??? So I formatted one..." -
Hi, I'm trying to write a small application (www.aspestrand.com) that sits in the system tray and is hidden on start up. I've tried a lot of different things like setting the style before creation to be not visible, etc... but the best i can get is the dialog flashing on the screen once before it gets the message to hide which i post OnInitDialog() BOOL CReminderDlg::OnInitDialog() { CMenuDlg::OnInitDialog(); // some initialization .......................... // hide window PostMessage(WM_COMMAND, IDC_HIDE); // other initialization .......................... return TRUE; } void CReminderDlg::OnHide() { ShowWindow(SW_HIDE); } Is there a way to have the dialog not show unless i call ShowWindow(SW_NORMAL) on it? The dialog is set up never to show up on the task bar. thanks Bryn Aspestrand
Take a look Chris's TrayCalender application. It does exactly what you want I think.
-
Hi, I'm trying to write a small application (www.aspestrand.com) that sits in the system tray and is hidden on start up. I've tried a lot of different things like setting the style before creation to be not visible, etc... but the best i can get is the dialog flashing on the screen once before it gets the message to hide which i post OnInitDialog() BOOL CReminderDlg::OnInitDialog() { CMenuDlg::OnInitDialog(); // some initialization .......................... // hide window PostMessage(WM_COMMAND, IDC_HIDE); // other initialization .......................... return TRUE; } void CReminderDlg::OnHide() { ShowWindow(SW_HIDE); } Is there a way to have the dialog not show unless i call ShowWindow(SW_NORMAL) on it? The dialog is set up never to show up on the task bar. thanks Bryn Aspestrand
Hi I think u can control this is InitInstance() of ur app class. Thanks Krithika