Solved

How to create hidden dialog box

Posted on 1998-08-11
4
717 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
[X]
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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 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