积极答复者
使用SendMessage发送Alt+S

问题
-
怎样使用SendMessage发送Alt+S?
我的方法是
SendMessage(hwnd2, 0x0104, 0x00000012, 0x20380001);
SendMessage(hwnd2, 0x0104, 0x00000053, 0x201F0001);
SendMessage(hwnd2, 0x0106, 0x00000073, 0x201F0001);SendMessage(hwnd2, 0x0101, 0x00000012, 0xC0380001);
SendMessage(hwnd2, 0x0101, 0x00000053, 0xC01F0001);完全按照spy++翻译的,但是发送之后,却不成功,spy++上却显示在每一条命令后多一个空发送,相当于
SendMessage(hwnd2, 0x0104, 0x00000012, 0x20380001);
SendMessage(hwnd2, 0x0104, 0x00000000, 0x20380001);
SendMessage(hwnd2, 0x0104, 0x00000053, 0x201F0001);
SendMessage(hwnd2, 0x0104, 0x00000000, 0x20380001);
SendMessage(hwnd2, 0x0106, 0x00000073, 0x201F0001);
SendMessage(hwnd2, 0x0101, 0x00000012, 0xC0380001);
SendMessage(hwnd2, 0x0101, 0x00000053, 0xC01F0001);这是什么情况?图片的上方是SendMessage的,下方是手动的。
答案
-
这就是一个API,构造你的参数 调用这个API就可以了:http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
http://www.cnblogs.com/yedaoq/archive/2010/12/30/1922305.html
还有这个project:http://www.codeproject.com/Articles/2334/Toggling-the-Num-Lock-Caps-Lock-and-Scroll-Lock-ke
希望有用。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Mike FengModerator 2012年6月6日 11:27
全部回复
-
SendInput
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
这就是一个API,构造你的参数 调用这个API就可以了:http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
http://www.cnblogs.com/yedaoq/archive/2010/12/30/1922305.html
还有这个project:http://www.codeproject.com/Articles/2334/Toggling-the-Num-Lock-Caps-Lock-and-Scroll-Lock-ke
希望有用。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Mike FengModerator 2012年6月6日 11:27