I have a dialog where the user is able to enter information and then press the Go button. When they press this button I disable the form elements (buttons etc) and create a worker thread using AfxBeginThread( ... )
. Once the worker thread has completed I want it to send a message to the UI thread so as to re-enable the form. I am using ::PostMessage( ... )
to send the message, but I can't find how to intercept these messages.
i've searched online (Link #1, Link #2, Link #3) but I can't find an understandable example of the code to implement my own message listener. In the header I can see some crazy define statements (started with DECLARE_MESSAGE_MAP()
) which looks like it may have something to do with it, but I can't figure it out.
Any help is much appreciated. Thanks.