大漠后台怎么切换窗口不激活窗口到前台?
Callabc1Callabc2Callabc3Callabc4Subabc1dm_ret=dm.SetWindowState(MyArray(0),1)//激活窗口dm...
Call abc1
Call abc2
Call abc3
Call abc4
Sub abc1
dm_ret = dm.SetWindowState(MyArray(0),1)//激活窗口
dm_ret = dm.BindWindow(MyArray(0), "dx2", "dx", "dx", 0)//绑定窗口
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc2
dm_ret = dm.SetWindowState(MyArray(1),1)//激活窗口
dm_ret = dm.BindWindow(MyArray(1), "dx2", "dx", "dx", 0)//绑定窗口
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc3
dm_ret = dm.BindWindow(MyArray(0), "dx2", "dx", "dx", 0)//我现在又要用到窗口一,除了用这句我应该怎么用?
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc4
dm_ret = dm.BindWindow(MyArray(1), "dx2", "dx", "dx", 0)
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
求大神指教 展开
Call abc2
Call abc3
Call abc4
Sub abc1
dm_ret = dm.SetWindowState(MyArray(0),1)//激活窗口
dm_ret = dm.BindWindow(MyArray(0), "dx2", "dx", "dx", 0)//绑定窗口
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc2
dm_ret = dm.SetWindowState(MyArray(1),1)//激活窗口
dm_ret = dm.BindWindow(MyArray(1), "dx2", "dx", "dx", 0)//绑定窗口
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc3
dm_ret = dm.BindWindow(MyArray(0), "dx2", "dx", "dx", 0)//我现在又要用到窗口一,除了用这句我应该怎么用?
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
Sub abc4
dm_ret = dm.BindWindow(MyArray(1), "dx2", "dx", "dx", 0)
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
dm.MoveTo 953, 212
Delay 500
dm.LeftDoubleClick
Delay 1000
End Sub
求大神指教 展开
展开全部
用恢复窗口:dm_ret = dm.SetWindowState(MyArray(1),5)
我看你四个子程序除了窗口句柄,其他的内容都是一样的,其实用一个子程序即可,还有,后台模式是不需要切换窗口都前台的。
我看你四个子程序除了窗口句柄,其他的内容都是一样的,其实用一个子程序即可,还有,后台模式是不需要切换窗口都前台的。
更多追问追答
追问
我想要切到第一个窗口(后台切)
然后是操作
操作完后 切第二个窗口(后台切)
操作
再切到第一个窗口……希望不激活窗口求代码
就好比两个窗口交易一样
追答
就是用还原窗口,后面那个参数1改为5即可。不过,你既然已经是后台操作了,又何必要切换窗口,后台操作是不需要切换窗口的,后台可以多窗口同时操作,直接开启线程就可以了,还有,你这样频繁绑定窗口,窗口会崩溃直接退出,也就是说你这样写比较危险,很可能窗口会崩溃而自动关闭,由于我不清楚你具体目的,也不了解你逻辑的具体细节,就无法帮你修改代码了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询