Link to home
Start Free TrialLog in
Avatar of astickler
astickler

asked on

How to create hidden dialog box

I need a dialog box to implement an event log feature. Initially it should not be shown, but when an event occurs, it will popup and show a history of received events (in a listbox).

In the WM_INITDIALOG message handler I call ShowWindow(FALSE), but the dialog still appears. My current solution is to set a timer to hide the window after n seconds, but it appears on the task bar for this period of time.

Is there a cleaner way of doing this so that the dialog is always created hidden?
Thanks,
Andrew Stickler.
Avatar of WDB
WDB

Is the visible flag set when the dialog is created? If so turn it off. I have created similar dialogs for error reporting. I create my main dialog but I never call ShowWindow(). When I need to show something I pop up a different dialog to report the event. Then when I remove the event reporting dialog the original main dialog window is still invisible and continues to run.
Avatar of astickler

ASKER

The dialog is defined with the visible style off - incidently, the help omn DialogBoxParam() says the dialog is displayed regardless of the WS_VISIBLE style.

Are you sure that when you start your program it doesn't 'flash up' on the task bar?
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Modeless dialog - why didn't I think of that! Thnak you very much 'thui'