FMP 发表于 2015-1-7 17:23:17

訊息視窗"確定"

程式執行時會跳出安裝驅動程式的訊息,必須點"安裝驅動程式(I)"才可繼續
所以使用ControlClick來執行
但目前執行到視窗跳出後就無反應...請位各位要修正哪個部分??RunAsWait( $sUserName,$sDomain,$sPassword,0,$Location,@SystemDir,@SW_HIDE)

WinWaitActive("印表機")
ControlClick("印表機","","Button1")   

WinWaitActive("新增印表機")   
WinClose("新增印表機")   

Run($Location,@SystemDir,@SW_SHOW)

Exit

李岸 发表于 2015-1-7 17:40:56

RunAsWait( $sUserName,$sDomain,$sPassword,0,$Location,@SystemDir,@SW_HIDE)
WinWait("印表機")
WinActive("印表機")
WinWaitActive("印表機")
ControlClick("印表機","","Button1")   

WinWait("印表機")
WinActive("印表機")
WinWaitActive("新增印表機")   
WinClose("新增印表機")   

Run($Location,@SystemDir,@SW_SHOW)

Exit

mshuking 发表于 2015-1-8 12:07:53

本帖最后由 mshuking 于 2015-1-8 12:09 编辑

RunAsWait( $sUserName,$sDomain,$sPassword,0,$Location,@SystemDir,@SW_HIDE)
WinWaitActive("印表機","安装驅動程式(&l)")
WinActive("印表機","安装驅動程式(&l)")
ControlClick("印表機","安装驅動程式(&l)","Button1")   
WinWaitActive("新增印表機","")
WinActive("新增印表機","")   
WinClose("新增印表機")   
Run($Location,@SystemDir,@SW_SHOW)
Exit
页: [1]
查看完整版本: 訊息視窗"確定"