Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to create hidden dialog box

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…

839 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