S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
我想用一下代码模拟按下ALT+S组合键,不过没有作用,在用QQ测试时发现并没有成功模拟按下ALT+S组合键,倒是把字母"S"输入到对话框中去了<br>keybd_event(MOD_ALT, MapVirtualKey(MOD_ALT, 0), 0, 0);<br>keybd_event(Ord('S'), MapVirtualKey(Ord('S'), 0), 0, 0);<br>keybd_event(Ord('S'), MapVirtualKey(Ord('S'), 0), KEYEVENTF_KEYUP, 0);<br>keybd_event(MOD_ALT, MapVirtualKey(MOD_ALT, 0), KEYEVENTF_KEYUP, 0);<br>不过,用以下却可以模拟Ctrl+Enter组合键,这是为何?<br>keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0);<br>keybd_event(Ord('V'), MapVirtualKey(Ord('V'), 0), 0, 0);<br>keybd_event(Ord('V'), MapVirtualKey(Ord('V'), 0), KEYEVENTF_KEYUP, 0);<br>keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), KEYEVENTF_KEYUP, 0);