找回密码
 加入
搜索
查看: 1662|回复: 2

[AU3基础] 同时运行多个记事本,如何根据进程或者句柄等区别操作

[复制链接]
发表于 2016-4-9 11:28:58 | 显示全部楼层 |阅读模式
同时运行了多个一样的程序,如何根据进程或者句柄执行不同的操作。;
主要碰到的问题是窗体句柄是相同的。
我可以将Notepad.exe改成不同的名字,但是句柄还是一样的。
有什么办法?
第一段
If ProcessExists("Notepad.exe")  Then
  WinActivate("[CLASS:Notepad]","")
  Local $pid = WinGetProcess("[CLASS:Notepad]")
  Local $handleTEST = WinGetHandle("[CLASS:Notepad]")
   ;MsgBox(0, "Example", $handleTEST)
send("123")
        ..........       
EndIf
;第二段
If ProcessExists("Notepad.exe")  Then
  WinActivate("[CLASS:Notepad]","")
  Local $pid = WinGetProcess("[CLASS:Notepad]")
  Local $handle= WinGetHandle("[CLASS:Notepad]")
   ;MsgBox(0, "Example", $handleTEST)
send("789")
        ..........       
EndIf
发表于 2016-4-9 14:36:43 | 显示全部楼层
Run("Notepad.exe")
Run("Notepad.exe")
WinWait("[CLASS:Notepad]")
Local $var=WinList("[CLASS:Notepad]")
ControlSetText($var[1][1],"","Edit1","123")
ControlSetText($var[2][1],"","Edit1","789")
 楼主| 发表于 2016-4-9 14:43:49 | 显示全部楼层
楼上厉害,我再学习学习。谢谢回复。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-3 12:00 , Processed in 0.081271 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表