Passing Sent Messages to Child and Popup Windows
Posted on 2004-04-21
I have a windows messenging delimma.
I perform several functions for my applications in worker threads and need to send messages back to the GUI to update itself and its child windows. I need to be able to send a parameter with the message to say which object number to update. I have come to understand that that means I cannot use a WM_COMMAND message, since wParam must be used to say what to do (for example ID_UPDATE_FORM) and lParam must be 0 so I cannot use it for telling which object to update. Someone please tell me if there is a good way around this.
As a result of this I went to the idea of using a WM_APP message instead. Then I could use the message itself to say what to do and the wParam to say which object it is and have lParam at my dispense for future needs. I implemented this and it works fine, except that I need to be able to SendMessage instead of PostMessage or it causes problems. I can catch the Posted Messages in my MainWnd's PreTranslateMessage() and then pass them from there to my child and popup windows. I just don't know how to do this with Sent messages. Anybody tell me how to do this?