Re: create window before calling CDialog::DoModal()?
"Frank Cusack" <fcusack@fcusack.com> wrote in message
news:m2ved48qjh.fsf@sucksless.local...
On Sat, 30 Jun 2007 23:04:05 -0400 Joseph M. Newcomer
<newcomer@flounder.com> wrote:
Set a simple boolean flag. Since there is only one thread involved,
There is not only one thread involved.
Frank, from what you previously wrote, I believe there really is only one
thread involved. Perhaps you think multiple threads are involved because it
is possible to popup the tray icon menu while your modal dialog is being
shown (because how else could you use the tray icon when a modal dialog is
supposed to block other UI while it is shown?). The primary (and only)
thread is showing the modal dialog, but that is pumping Windows messages
(i.e. it is sitting in a loop calling GetMessage and DispatchMessage) which
cause your tray icon to work. MFC disables user interface in other windows
in your app when the modal dialog is shown, but since you have no other
windows in your app, you don't see that. MFC doesn't disable the tray icon
or prevent the tray icon owner window from handling the right-click to show
the popup menu.
This isn't really very clear, but basically the modal dialog isn't blocking
the tray icon, and there is only 1 thread.
-- David