Embedding HWND into external process using SetParent

Well, I finally found the answer to my question.

To fix the issue with the main app losing focus you need to use the AttachThreadInput function to attach the embedded window thread to the main app thread.

Also, one can use the TranslateAccelerator function in response to WM_KEYDOWN messages to ensure accelerator messages of the main app are triggered.

Leave a Comment