Click to See Complete Forum and Search --> : PostMessage
Rich Peters
May 2nd, 1999, 01:35 AM
I am trying to post a message from a modal dialog running in a second thread back to the view window that is its parent in the primary thread. I post the message, but it nevers arrives in the view window. Post message returns success, but with Spy++ I never see it.
Is there something fatally wrong with this scheme? Why wouldnt this work?
thanks.
Paul McKenzie
May 2nd, 1999, 09:57 PM
If the modal dialog disabled the parent, the message queue of the parent is suspended. The message is processed once the modal dialog is closed. Modal dialogs have their own message queue independent of the parent.
This is how modal dialogs accomplish being modal.
Regards,
Paul McKenzie
Modal dialogs block the parent's message queue. Your message was posted, but the queue is halted until the dialog is closed.
Rich Peters
May 3rd, 1999, 01:28 AM
I guess I never thought this out clearly. I've only done what I'm trying to do with modeless dialogs. What your saying makes sense.
Would a SendMessage work? But not across threads I imagine.
How do the Toolbar dialogs where you can drag and drop but
Paul McKenzie
May 3rd, 1999, 03:59 AM
I'm not an expert in the way the toolbars work, but I would think that they are really modeless dialogs or just child windows of the%
Rich Peters
May 3rd, 1999, 04:32 PM
What I was refering to was the Modal Dialog that comes up where you drag and drop buttons on a tool bar. I am curious to know how that works.
Anyway I modified my dialog to be modeless, and I now see the message hit my frame window. It never makes it to the view, however.
I was using ON_MESSAGE() in the view for a message WM_USER+4096. Do you have any idea why this doesnt work? I thought the Main frame would route the message to the view. I have tried sending it direct to the view, but that doesnt help.
Rich
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.