Sign in to follow this  
Followers 0
JimC

Winwait help

2 posts in this topic

The following code opens an external app called drvcomp.exe and clicks a button to start it. The code added on 1-25 was added to check to see if drvcomp.exe crashes. It seems to get stuck and not get beyond the newly added code. I am using this functioanlaity correctly? Any help would be greatly appreciated.

Opt("WinTitleMatchMode", 3)

run("drvcomp.exe",@SystemDir)

WinWait ("Driver Compressor Setup: Options")

WinActivate("Driver Compressor Setup: Options" , "")

WinSetOnTop("Driver Compressor Setup: Options", "",1)

ControlClick("[Class:#32770]", "Start", "[ClassNN:Button2]", "left", 1)

$message = GUICtrlCreateLabel('Drivers are being integrated to ' & $xpcd & '\I386 directory.', 10, 405, 400, 20)

;this is test code placed on 1-25 to test in drvcomp fails

WinWait ("DrvComp - Driver Compressor tool", "",120)

WinActivate("DrvComp - Driver Compressor tool" , "")

WinSetOnTop("DrvComp - Driver Compressor tool", "",1)

msgbox(1,"Driver Compressor Terminated Abnormally", "Unfortunately you will need to start over !")

ControlClick("[Class:#32770]", "Close", "[ClassNN:Button1]", "left", 1)

WinWait("Program Error", "", 10)

WinActivate("Program Error" , "")

WinSetOnTop("Program Error", "",1)

ControlClick("[Class:NotifyDialog]", "Close", "[ClassNN:Button1]", "left", 1)

If Not ProcessExists("drvcomp.exe") then Exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

WinWait ("Driver Compressor Setup: Completed")

WinActivate("Driver Compressor Setup: Completed" , "")

WinSetOnTop("Driver Compressor Setup: Completed", "",1)

ControlClick("[Class:#32770]", "Close", "[ClassNN:Button2]", "left", 1)

Share this post


Link to post
Share on other sites



Add more error handling to your code by checking the return values of the Win.... functions.

That should at least give you a better idea where it gets stuck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0