I\'ve got a background thread that is polling a server. When there\'s data, I want to handle the data on the UI thread. If I store the hwnd of the main window.
One thing that you could do - use an inter-thread signalling object perhaps as simple as a boolean flag. When data appears on the server polling thread, you can signal the flag. You could check for this flag in the message loop of your UI thread. Alternatively, you could just send the UI thread a custom window message.
Now that I re-read your question - since you can't change the UI code, this approach wouldn't work. You could use the WIN32 API to add your own custom message hook function to fix this problem.