楼上这样写无效的,浏览器有多个子窗口,必须获取到正确的子窗口输入命令才有效
//我只有遨游,只能写个范例给你
Hwnd = Plugin.Window.Find("Maxthon3Cls_MainFrm", 0)
HwndEx = Plugin.Window.FindEx(Hwnd, 0, "Maxthon3Cls_BrowserView", 0)
Hwnds = Plugin.Window.FindEx(HwndEX, 0, "Maxthon3Cls_WebViewHost", 0)
Do
Call Plugin.Bkgnd.KeyPress(Hwnds, 87)
Delay 1000
Loop
Hwnd = Plugin.Window.Foreground()
Do
Call Plugin.Bkgnd.KeyPress(Hwnd, 87)
Delay 1000
Loop
应你要求,指定窗口无限循环一秒按一次W键
Hwnd = Plugin.Window.Mousepoint()
Do
Call Plugin.Bkgnd.KeyPress(Hwnd, 87)
Delay 1000
Loop