mann Posted May 5, 2009 Share Posted May 5, 2009 Auoit can recognize toolstripbutton used in C# using Windows platform. Script: Run("C:\Program Files\POS\POS.Lounge.exe") WinWaitActive("POS v2.0.0.78 [Delhi Airport Arrival - T01]","",300) ControlFocus("POS v2.0.0.78 [Delhi Airport Arrival - T01]","","[CLASS:tsbon]") ControlClick("POS v2.0.0.78 [Delhi Airport Arrival - T01]","","[CLASS:tsbon]","left",1,65,40) Whats wrong in this script? It is not clicking on the button specified. Link to comment Share on other sites More sharing options...
bo8ster Posted May 5, 2009 Share Posted May 5, 2009 Nothing stands out. You could also try using WinGetHandle or ControlGetHandle and passing ControlClick a control handle. I do suggest looking at @error for the return state. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
mann Posted May 5, 2009 Author Share Posted May 5, 2009 Nothing stands out. You could also try using WinGetHandle or ControlGetHandle and passing ControlClick a control handle. I do suggest looking at @error for the return state. Hi, Now i have used script like this: Run("C:\Program Files\POS\POS.Lounge.exe") AutoItSetOption("WinTitleMatchMode", 4) $handle=WinGetHandle("POS v2.0.0.78 [Delhi Airport Arrival - T01]","[CLASS:tsbOn]") If @error Then Msgbox(4096,"Error","Wrong Window") Else controlsend($handle,"","tsbOn","123456") EndIf ControlClick("POS v2.0.0.78 [Delhi Airport Arrival - T01]]","","","left",1,170,60) It is returning error, whats wrong in this script now. Link to comment Share on other sites More sharing options...
mann Posted May 5, 2009 Author Share Posted May 5, 2009 Can anybody tell me what can be done. Link to comment Share on other sites More sharing options...
Juvigy Posted May 5, 2009 Share Posted May 5, 2009 Is the "wingethandle" returning the error? You can use the bellow script to test for that , just start the pos.longe first. $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Link to comment Share on other sites More sharing options...
mann Posted May 5, 2009 Author Share Posted May 5, 2009 Above code is displaying the window title, same as i have used in above script. What else i can do now. 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