1. 教授回复
ChatGPT-o1:
ImmGetContext()
is not designed to work across process boundaries. It is indicates that a thread should not access the input context created by another thread, which implies that the function is intended for use within the same process. Therefore, when you attempt to call ImmGetContext on a window from another process, it will fail, resulting in a handle of 0.- To control the IME status of windows from other processes, you would need to use inter-process communication (IPC) methods to send messages or commands to the target process, which can then handle the IME context appropriately within its own execution context.
通义千问:
ImmGetContext()
函数用于获取与指定窗口关联的输入法编辑器 (IME) 的输入上下文。根据已知的实践经验,ImmGetContext
无法在跨进程边界的情况下正常工作。每个线程在 Windows 中都有它自己的输入状态和键盘布局,这包括 IME 输入上下文。因此,一个线程不应该尝试访问由另一个线程创建的输入上下文,这是因为它们可能运行在不同的进程中,有着不同的输入状态。
2. 在 Microsoft Developer Community 进行提问:“Feature Request for Enhanced Documentation on ImmGetContext
in Development”
目前仍没有收到回复;