Solved

How to create hidden dialog box

Posted on 1998-08-11
4
697 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

813 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

13 Experts available now in Live!

Get 1:1 Help Now