你参考一下,找到窗口后,要激活->最小化->还原,就会得到想要的窗口了
以下是获取wow窗口
Delay 1000
Rem TOSTART
Import window.dll
VBS hwnd=obj.FindWindow("","魔兽世界")
VBS hwnd1=obj.FindWindow("","World of Warcraft")
VBS hwnd2=obj.FindWindow("","魔兽世界")
If hwnd or hwnd1 or hwnd2
If hwnd
Plugin Window.Active(hwnd)
Plugin Window.Min(hwnd)
Plugin Window.Restore(hwnd)
Goto TOSTART1
EndIf
If hwnd1
Plugin Window.Active(hwnd1)
Plugin Window.Min(hwnd1)
Plugin Window.Restore(hwnd1)
Goto TOSTART1
EndIf
If hwnd2
Plugin Window.Active(hwnd2)
Plugin Window.Min(hwnd2)
Plugin Window.Restore(hwnd2)
Goto TOSTART1
EndIf
Else
MessageBox 请先进入wow游戏,并设置为窗口模式
Goto TOquit
EndIf
///以下是获得当前窗口(刚激活的那个)大小
VBSBegin
Dim win,client,qx,qy,zx,zy
win=Window.Foreground()
client=Window.GetClientRect(win)
s=split(client,"|")
qx=s(0)
qy=s(1)
zx=s(2)
zy=s(3)
VBSEnd
1、下载361后台插件
2、编写脚本
例如:脚本头加入
Plugin
cs=Window.GetKeyFocusWnd()
目的是获取当前窗口句柄
接着可以设置脚本命令,比如按回车键:
Plugin
BGKM5.KeyClick(cs,13)
“()”里的cs代表窗口代号,13为回车键的键码,键码可以在按键精灵中获得
如果要使用鼠标:
移动鼠标到“cs”窗口的x50,y50坐标位置:
BGKM5.MMove(cs,50,50)
在“cs”窗口的x50,y50位置单击左键:
BGKM5.LClick(cs,50.50)
在“cs”窗口的x50,y50位置单击右键:
BGKM5.RClick(cs,50.50)
在“cs”窗口的x50,y50位置双击左键:
BGKM5.LDBCLK(cs,50.50)
还有更多脚本指令,楼主可以去兄弟论坛找找看,希望能对你有帮助。
把鼠标指向可以发送按键的窗口,然后启动脚本即可运行:
Plugin
hwnd
=
Window.MousePoint()
Rem
Loop
Plugin
Window.SendKeyDown(hwnd,17)
Delay
203
Plugin
Window.SendKeyDown(hwnd,9)
Delay
125
Plugin
Window.SendKeyUp(hwnd,17)
Delay
63
Plugin
Window.SendKeyUp(hwnd,9)
Delay
609
Plugin
Window.SendKeyDown(hwnd,112)
Delay
78
Plugin
Window.SendKeyUp(hwnd,112)
Goto
Loop
如若不要循环,则去掉最后一行"Goto
Loop"