本人新手。制作了后台脚本,运行的时候窗口会跳到前台来,影响我正常操作,但是有两次同样的脚本没有出现伪后台情况。求大神这种情况怎么破
Hwnd = Plugin.Window.Find("Maxthon3Cls_MainFrm", 0)
Plugin.Window.Active Hwnd
Rem 开始
Rem a
Call Plugin.Bkgnd.KeyPress(Hwnd, 117)//117=F6遨游浏览器
选中地址栏的快捷键,之前一直用的是鼠标左键单击地址栏,就是因为出现伪后台情况才尝试这种操作
Call Plugin.Bkgnd.SendString(Hwnd, "http://naruto.xixigames.com/PlayGame.aspx?sid=465&inID=1")
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 13)//按下回车键
Delay 7500
Hwnd1 = Plugin.Window.FindEx(Hwnd, 0, "Mx_WidgetWin_0", 0)
Hwnd2 = Plugin.Window.FindEx(Hwnd1, 0, "WrapperNativeWindowClass", 0)
Hwnd3 = Plugin.Window.FindEx(Hwnd2, 0, "NativeWindowClass", 0)//网页游戏可以操作的句柄
Plugin.Window.Active Hwnd1
Plugin.Window.Active Hwnd2
Plugin.Window.Active Hwnd3
YS1 = Plugin.Bkgnd.GetPixelColor(Hwnd, 88, 151)
YS2 = Plugin.Bkgnd.GetPixelColor(Hwnd1, 47, 47)
YS3 = Plugin.Bkgnd.GetPixelColor(Hwnd2, 47, 47)
YS4 = Plugin.Bkgnd.GetPixelColor(Hwnd3, 47, 47)//这些事判断掉线取色
Delay 5000
If YS1="8E9EB3" Then
Goto a
End If
If YS1="ECECEC" Then
Goto a
End If
If YS2="959595" Then
Goto a
End If
If YS2="8E9EB3" Then
Goto a
End If
If YS3="8E9EB3" Then
Goto a
End If
If YS4="8E9EB3" Then
Goto a
End If
XY = Plugin.Bkgnd.FindPic(Hwnd3, 0, 0, 1824, 1800, "D:\按键精灵\按键精灵2014\screen\红点.bmp", 2, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
Call Plugin.Bkgnd.LeftClick(Hwnd3, X, Y)
Delay 3620
Call Plugin.Bkgnd.KeyPress(Hwnd3, 72)
Delay 8000
Goto 开始
Hwnd = Plugin.Window.Find("Maxthon3Cls_MainFrm", 0)
Plugin.Window.Active Hwnd
Rem 开始
Rem a
Call Plugin.Bkgnd.KeyPress(Hwnd, 117)//117=F6遨游浏览器
选中地址栏的快捷键,之前一直用的是鼠标左键单击地址栏,就是因为出现伪后台情况才尝试这种操作
Call Plugin.Bkgnd.SendString(Hwnd, "http://naruto.xixigames.com/PlayGame.aspx?sid=465&inID=1")
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 13)//按下回车键
Delay 7500
Hwnd1 = Plugin.Window.FindEx(Hwnd, 0, "Mx_WidgetWin_0", 0)
Hwnd2 = Plugin.Window.FindEx(Hwnd1, 0, "WrapperNativeWindowClass", 0)
Hwnd3 = Plugin.Window.FindEx(Hwnd2, 0, "NativeWindowClass", 0)//网页游戏可以操作的句柄
Plugin.Window.Active Hwnd1
Plugin.Window.Active Hwnd2
Plugin.Window.Active Hwnd3
YS1 = Plugin.Bkgnd.GetPixelColor(Hwnd, 88, 151)
YS2 = Plugin.Bkgnd.GetPixelColor(Hwnd1, 47, 47)
YS3 = Plugin.Bkgnd.GetPixelColor(Hwnd2, 47, 47)
YS4 = Plugin.Bkgnd.GetPixelColor(Hwnd3, 47, 47)//这些事判断掉线取色
Delay 5000
If YS1="8E9EB3" Then
Goto a
End If
If YS1="ECECEC" Then
Goto a
End If
If YS2="959595" Then
Goto a
End If
If YS2="8E9EB3" Then
Goto a
End If
If YS3="8E9EB3" Then
Goto a
End If
If YS4="8E9EB3" Then
Goto a
End If
XY = Plugin.Bkgnd.FindPic(Hwnd3, 0, 0, 1824, 1800, "D:\按键精灵\按键精灵2014\screen\红点.bmp", 2, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
Call Plugin.Bkgnd.LeftClick(Hwnd3, X, Y)
Delay 3620
Call Plugin.Bkgnd.KeyPress(Hwnd3, 72)
Delay 8000
Goto 开始