B
Big Bob
I am trying to create a host application that will create a server, and then
optionally display a GUI element (controlled by a command line argument).
Here's what I've done so far:
1. Created a console application that creates the server (I started with a
windows application, but couldn't find any sort of "app" code where I could
add the conditional GUI code)
2. Switched the console application to be a "Windows Application" to remove
the console window
3. If the user has entered the /SHOWGUI command line prompt, popup a
modeless dialog
4. Show a system tray icon with a context menu, which contains a "Shutdown"
item
5. At the end of the Main() function, block until the user selects shutdown
on the context menu.
I'm having problems with the fifth item. I can't find a way to block that
doesn't also kill the GUI. Just waiting on a mutex makes the GUI
unresponsive. How do I block, but keep the message pump going? (Is there
still a message pump?)
In the olden MFC days, I'd just return TRUE from the InitiInstance override
and everything would run.
Thanks,
Aaron
optionally display a GUI element (controlled by a command line argument).
Here's what I've done so far:
1. Created a console application that creates the server (I started with a
windows application, but couldn't find any sort of "app" code where I could
add the conditional GUI code)
2. Switched the console application to be a "Windows Application" to remove
the console window
3. If the user has entered the /SHOWGUI command line prompt, popup a
modeless dialog
4. Show a system tray icon with a context menu, which contains a "Shutdown"
item
5. At the end of the Main() function, block until the user selects shutdown
on the context menu.
I'm having problems with the fifth item. I can't find a way to block that
doesn't also kill the GUI. Just waiting on a mutex makes the GUI
unresponsive. How do I block, but keep the message pump going? (Is there
still a message pump?)
In the olden MFC days, I'd just return TRUE from the InitiInstance override
and everything would run.
Thanks,
Aaron