[comp.windows.ms.programmer] Calling GetMessage in a dialog box proc

mcorlett@ibmpcug.co.uk (M A Corlett) (06/12/91)

Re: Calling GetMessage() from dialog box func

From a DLL I'm writing, I have to synchronise with another app which 
sets up some data for me. The ideal place for the DLL to be called is when 
processing the WM_INITDIALOG message in the callers (modal) dlg box proc. 
The other app calls PostMessage with a Registered message and hWnd == 0xFFFF, 
so telling everyone (and, in particular, my DLL) that the data is ready. 
The DLL does a GetMessage( &msg, NULL.... ) loop to catch the message in
question.

Now, the problem is, that this message is never seen by the DLL if the
caller is in the dialog box proc. If its in the main window proc, 
processing a WM_COMMAND msg, fine. But not in the dialog box proc. According
to Spy, the main window never even sees the message!

Any clues out there?

Mike Corlett, mcorlett@ibmpcug.co.uk


-- 
Automatic Disclaimer:
The views expressed above are those of the author alone and may not
represent the views of the IBM PC User Group.
--