冬
冬月
Unregistered / Unconfirmed
GUEST, unregistred user!
一个FORM上放一个WebBrowser1,模拟Ctrl+Enter组合按键向WebBrowser1发送,用了 keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), 0, 0); //按下Ctrl键 keybd_event(VK_Return, MapVirtualKey(VK_Return, 0), 0, 0); keybd_event(VK_Return, MapVirtualKey(VK_Return, 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), KEYEVENTF_KEYUP, 0); //放开Ctrl键可以,但是当窗体不是当前窗体,或者最小化的时候不起作用。用了PostMessage(WebBrowser1.Handle, WM_KEYDOWN, VK_Control, 0); PostMessage(WebBrowser1.Handle, WM_KEYDOWN, VK_Return, 0); PostMessage(WebBrowser1.Handle, WM_KEYUP, VK_Control, 0); PostMessage(WebBrowser1.Handle, WM_KEYUP, VK_Return, 0);没用,请教高手