mud409 Posted December 22, 2010 Share Posted December 22, 2010 (edited) I'm trying to use a script of mine on Windows 7, but it hangs up at the controlclick code below (works absolutely fine in xp). As well, that window info was taken from Win7, not XP (not sure if it matters). *Note, the same exact code works (in win7) with an older version of the application I'm trying to automate. Run(@WorkingDir & "\" & "KDev.exe") $wait = WinWait("K Dev", "", 10) If $wait = 0 Then MsgBox(0, "Error", "K Dev has not loaded. Now Restarting.", "") Terminate() Else If Not WinActive("K Dev", "") Then WinActivate("K Dev", "") WinWaitActive("K Dev", "") EndIf Opt("WinTitleMatchMode", 2) ControlFocus ("K Dev", "", "SysListView321") ControlClick("K Dev", "", "SysListView321", "right", 1) expandcollapse popup>>>> Window <<<< Title: K Dev Class: MainClass Position: -4, -4 Size: 1688, 1030 Style: 0x95CF0054 ExStyle: 0x00010110 Handle: 0x015201B4 >>>> Control <<<< Class: SysListView32 Instance: 1 ClassnameNN: SysListView321 Name: Advanced (Class): [CLASS:SysListView32; INSTANCE:1] ID: 1000 Text: List1 Position: 162, 30 Size: 680, 932 ControlClick Coords: 566, 294 Style: 0x5011050D ExStyle: 0x00000204 Handle: 0x025C0498 >>>> Mouse <<<< Position: 728, 362 Cursor ID: 2 Color: 0xFFFFFF >>>> StatusBar <<<< 1: Working 2: 3: 4: >>>> ToolsBar <<<< >>>> Visible Text <<<< Tree1 List1 Edited December 22, 2010 by mud409 Link to comment Share on other sites More sharing options...
jaberwacky Posted December 22, 2010 Share Posted December 22, 2010 Try this version and report the results: Run(@WorkingDir & "\" & "KDev.exe") Global Const $window_title = "K Dev" $wait = WinWait($window_title, "", 10) If $wait = 0 Then MsgBox(0, "Error", "K Dev has not loaded. Now Restarting.") Terminate() Else If Not WinActive($window_title) Then WinActivate($window_title) EndIf WinWaitActive($window_title) EndIf Opt("WinTitleMatchMode", 2) ConsoleWrite("ControlFocus: " & ControlFocus($window_title, "", "SysListView321") & @LF) ConsoleWrite("ControlClick: " & ControlClick($window_title, "", "SysListView321", "right") & @LF) It's essentially the same as yours but with error checking. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
mud409 Posted December 22, 2010 Author Share Posted December 22, 2010 (edited) Didn't work, but below was reported. ControlFocus: 1 ControlClick: 1 Edited December 22, 2010 by mud409 Link to comment Share on other sites More sharing options...
jaberwacky Posted December 22, 2010 Share Posted December 22, 2010 (edited) That means both functions reported that they were successful, right? That WinWaitAcitve seems unneccesary. Edited December 22, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now