Various issues using SetParent to embed window into external process [duplicate]

佐手、 提交于 2019-12-06 15:14:57

When my window gains input focus, the main application window of the external process loses focus (i.e. title bar changes color).

You need to use AttachThreadInput to attach your process's thread to the input queue of the host process. In addition to synchronizing message processing across all attached threads, this causes them to share focus, asynchronous key state, activation, and other input-related properties.

Keyboard shortcut commands of the main application do not work while my window has focus.

When your window has keyboard focus, the thread that owns your window receives all keyboard messages from the system. If you need the main window's UI thread to handle accelerators, you must somehow route keyboard input to that thread for preprocessing. How you do this depends largely on the UI technologies you are using for your applications and how you need accelerators to be processed.

Building a user interface that spans multiple threads in different processes is difficult and there are many pitfalls.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!