虚拟键盘的消息队列,进程间GetKeyboardState
在一个进程里改变键盘状态如大小写,在第二个进程里,第一次是取不到正确的大小写状态的。
查了好多资料,看到一句这个话 :GetKeyState returns the virtual key state. In other words, GetKeyState reports the state of the keyboard based on the messages you have retrieved from your input queue. This is not the same as the physical keyboard state:
•
If the user has typed ahead, GetKeyState doesn't report those changes until you use the PeekMessage function or the GetMessage function to retrieve the message from your input queue.
•
If the user has switched to another program, then the GetKeyState function will not see the input that the user typed into that other program, since that input was not sent to your input queue.
在两个进程中,虚拟键盘是两个消息队列,新的进程在消息队列没有过来之前,是收不到正确的键盘消息,,希望能给有大神指点,可以手动的在期望的进程里,让消息队列和虚拟键盘连接起来。。。表达的不太好。