DELPHI 发送 CTRL+ENTER

如何向 WebBrowser1 发送 CTRL+ENTER
2024-12-14 11:30:23
推荐回答(1个)
回答1:

发消息不知道,但可以模拟按键
WebBrowser1.SetFocus;
keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0);
keybd_event(13, MapVirtualKey(13, 0), 0, 0);
keybd_event(13, MapVirtualKey(13, 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), KEYEVENTF_KEYUP, 0);