Blade1 Posted June 12, 2011 Share Posted June 12, 2011 Hi, I have a wizard-type GUI application and I am trying to automate it. There is a button, of which the details are below, but when I attempt to click it with the code below: ControlClick("Gendarme", "", "[iD:198304; INSTANCE:2]") The window's title is Gendarme so all of that is correct. Nothing happens. Any ideas why? Details on the specific button are in the screenshot below: http://imageshack.us/photo/my-images/200/gendarmebuttondetails.png/ Thanks Link to comment Share on other sites More sharing options...
JohnOne Posted June 12, 2011 Share Posted June 12, 2011 ControlClick("Gendarme", "", "[NAME:next_button]") Perhaps AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blade1 Posted June 12, 2011 Author Share Posted June 12, 2011 ControlClick("Gendarme", "", "[NAME:next_button]") Perhaps Hi, That didn't work either. Anyone know the solution? I am executing on Windows 7 Ultimate 64 bit, is there anything I should change on the OS-level (bare in mind that although UAC is on, this isn't an issue here, obviously). Thanks! Link to comment Share on other sites More sharing options...
JohnOne Posted June 12, 2011 Share Posted June 12, 2011 ControlClick("Gendarme", "", "[CLASS:WindowsForms.10.BUTTON.app.0.2bf8098_r11_ad12; INSTANCE:2]") etc... try other ways too, you understand. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blade1 Posted July 1, 2011 Author Share Posted July 1, 2011 ControlClick("Gendarme", "", "[CLASS:WindowsForms.10.BUTTON.app.0.2bf8098_r11_ad12; INSTANCE:2]") etc... try other ways too, you understand. That didn't work either? What else can I do? Link to comment Share on other sites More sharing options...
monoscout999 Posted July 1, 2011 Share Posted July 1, 2011 (edited) ControlClick("Gendarme", "", "[CLASS:WindowsForms.10.BUTTON.app.0.2bf8098_r11_ad1; INSTANCE:2]") this? Edited July 1, 2011 by monoscout999 Link to comment Share on other sites More sharing options...
Blade1 Posted July 3, 2011 Author Share Posted July 3, 2011 Still didn't work. Absolutely nothing happens. Link to comment Share on other sites More sharing options...
monoscout999 Posted July 3, 2011 Share Posted July 3, 2011 (edited) try this. #include <WindowsConstants.au3> #Include <winapi.au3> #Include <GuiButton.au3> #Include <array.au3> ;~ $winHndl = wingethandle("Gendarme") ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $winHndl = ' & $winHndl & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ;~ $BtnHndl = ControlGetHandle($winHndl,"","[CLASS:WindowsForms.10.BUTTON.app.0.2bf8098_r11_ad1; INSTANCE:2]") ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $BtnHndl = ' & $BtnHndl & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $winHndl = wingethandle("[CLASS:CalcFrame]") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $winHndl = ' & $winHndl & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $BtnHndl = ControlGetHandle($winHndl,"","[CLASS:Button; INSTANCE:10]") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $BtnHndl = ' & $BtnHndl & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console _sendclick() Func _sendclick() Local $WM_COMMAND = 0x0111 Local $lParam = $BtnHndl Local $nCtrlID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $BtnHndl) ; _arraydisplay($nCtrlID) local $wParam = _WinAPI_MakeLong($nCtrlID[0], $BN_CLICKED) $message = _WinAPI_PostMessage($winHndl,$WM_COMMAND,$wParam,$lParam) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $message = ' & $message & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console EndFunc ;==>_sendclick Post the console return from SciTe. Edited July 3, 2011 by monoscout999 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