按键精灵怎么锁定一个窗口后台运行
While1IfColor165,97,"51FBC2",0ThenDelay500KeyPress"Down",1Delay500KeyPress"Enter",1De...
While 1
IfColor 165, 97, "51FBC2", 0 Then
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Enter", 1
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Enter", 1
Delay 500
KeyPress "Enter", 1
Delay 6000
KeyPress "Enter", 1
Else
Delay 500
KeyDown "Left", 1
Delay 500
KeyUp "Left", 1
Delay 500
KeyDown "Right", 1
Delay 500
KeyUp "Right", 1
Delay 500
End If
Wend
上面是我的脚本,怎么将他锁定个窗口后台运行,假如窗口句柄是“200422”,假如哈,该怎么做 展开
IfColor 165, 97, "51FBC2", 0 Then
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Enter", 1
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Down", 1
Delay 500
KeyPress "Enter", 1
Delay 500
KeyPress "Enter", 1
Delay 6000
KeyPress "Enter", 1
Else
Delay 500
KeyDown "Left", 1
Delay 500
KeyUp "Left", 1
Delay 500
KeyDown "Right", 1
Delay 500
KeyUp "Right", 1
Delay 500
End If
Wend
上面是我的脚本,怎么将他锁定个窗口后台运行,假如窗口句柄是“200422”,假如哈,该怎么做 展开
展开全部
请提供窗口标题和类名,窗口句柄每次开启都是不同的。如果要改成后台,请使用后台语句。
//得到鼠标指向的窗口句柄Hwnd = Plugin.Window.MousePoint()
或者
//得到当前最前面的窗口句柄Hwnd = Plugin.Window.Foreground()
然后把你的脚本置换成后台脚本语句 。直接放进去是不能用的。
例子:
Hwnd = 200422
GetColor = Plugin.Bkgnd.GetPixelColor(Hwnd, 165, 97)//这个坐标需要取后台坐标,不是屏幕坐标
If GetColor = "51FBC2" Then
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 40)
End If
//得到鼠标指向的窗口句柄Hwnd = Plugin.Window.MousePoint()
或者
//得到当前最前面的窗口句柄Hwnd = Plugin.Window.Foreground()
然后把你的脚本置换成后台脚本语句 。直接放进去是不能用的。
例子:
Hwnd = 200422
GetColor = Plugin.Bkgnd.GetPixelColor(Hwnd, 165, 97)//这个坐标需要取后台坐标,不是屏幕坐标
If GetColor = "51FBC2" Then
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 40)
End If
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询