Solved

How to create hidden dialog box

Posted on 1998-08-11
4
683 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:astickler
  • 2
4 Comments
 
LVL 2

Expert Comment

by:WDB
ID: 1413356
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.
0
 

Author Comment

by:astickler
ID: 1413357
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?
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1413358
If you do not want it to display on the task bar, create a hidden main window. From that main window's WM_CREATE message, create your dialog. This will prevent it from showing on the taskbar.

The preferred way would be to create a modeless dialog instead. This is a much cleaner solution.
0
 

Author Comment

by:astickler
ID: 1413359
Modeless dialog - why didn't I think of that! Thnak you very much 'thui'
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now