0

So i wanted to handle the win32 event callbacks from a separate thread so that i can handle other stuff in the background

I've tried std::thread but the declaration GetMessage(LPMSG,HWND,UINT,UINT) will only work with a window that is on the current thread

std::thread(EventThread) ; // i want to do this

So, Is there any way to wait for the events and stuff from another thread? Any help will be appreciated !

Bye, Samuel

Samuel
  • 315
  • 3
  • 14
  • What do you want to handle in the second thread? All window message or only some? What blocks you from setting up a message window in the second thread? – Werner Henze Jan 06 '19 at 16:54
  • You could get the message in the main thread and either spawn a new thread to process or communicate between the main thread and a spawned thread. – drescherjm Jan 06 '19 at 16:58
  • The message-checking can't be moved to another thread, but everything else can, which makes it possible to run things in parallel like you want. – Ben Voigt Jan 06 '19 at 16:59
  • 2
    "*i wanted to handle the win32 event callbacks from a separate thread so that i can handle other stuff in the background*" - do the "other stuff" in a separate thread instead. The UI should be handled by the main thread. – Remy Lebeau Jan 06 '19 at 17:06

0 Answers0