G
Guest
I am trying to write an event-driven application with no main window that
runs "forever". It waits on a named event and then displays a window
depending on data pased in a memory-mapped file. I started with a standard
console application and it all works fine, except that it does not terminate
tidily when the user logs off/shuts down. So, I figured I needed a message
loop to pick up WM_QUIT. I studied the code in "Waiting in a message loop"
(http://msdn.microsoft.com/library/d...us/dllproc/base/waiting_in_a_message_loop.asp) and implemented it in my Main(), using
MsgWaitForMultipleObjects(1, handles, false, INFINITE, QS_POSTMESSAGE +
QS_SENDMESSAGE);
to wait for either my named event (in 'handles') or a windows message. The
event fires fine, but no windows messages ever arrive. I am obviously doing
something wrong, Can anyone advise.
runs "forever". It waits on a named event and then displays a window
depending on data pased in a memory-mapped file. I started with a standard
console application and it all works fine, except that it does not terminate
tidily when the user logs off/shuts down. So, I figured I needed a message
loop to pick up WM_QUIT. I studied the code in "Waiting in a message loop"
(http://msdn.microsoft.com/library/d...us/dllproc/base/waiting_in_a_message_loop.asp) and implemented it in my Main(), using
MsgWaitForMultipleObjects(1, handles, false, INFINITE, QS_POSTMESSAGE +
QS_SENDMESSAGE);
to wait for either my named event (in 'handles') or a windows message. The
event fires fine, but no windows messages ever arrive. I am obviously doing
something wrong, Can anyone advise.