Embedding HWND into external process using SetParent

前端 未结 3 1880
一向
一向 2020-11-29 01:00

I\'m trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems that I

3条回答
  •  臣服心动
    2020-11-29 01:41

    I am not sure if you are still interested in this topic after almost three years. I am working on a similar application. My solution is to modify the window style before you call SetParent. With this solution, I don't have to call AttachThreadInput.

    However, one major issue of hosting child windows from an external process is that if the external process hangs while responding to a user keyboard or mouse input, the main application also freezes. The message loop in the main application is still running. However, it no longer receives user input events. Therefore, it appears as if it is hanging. I believe that's the direct result of AttachThreadInput since the input events of the two threades are now synchronized. If one of them is blocked, both are blocked.

提交回复
热议问题