如何向目标窗口发送一个Unicode 字符?

作者:半瓶墨水   链接:http://www.2maomao.com/blog/how-to-send-uchar-to-hwnd/

很多程序需要向某个窗口发送几个字符(比如自动化测试程序),怎么办呢?

在MSDN上搜索VK_PACKET可得:

VK_PACKET E7
Used to pass Unicode characters as if they were keystrokes. If VK_PACKET is used with SendInput, then the Unicode character to be delivered should be placed into the lower 16 bits of the scan code. If a keyboard message is removed from the message queue and the virtual key is VK_PACKET, then the Unicode character will be the upper 16 bits of the lparam.

留下回复