SovietGhost Posted September 25, 2008 Share Posted September 25, 2008 welll after read, read,and more reading, using search and etc, i still have my doubts of how i could do this. i'm automating some forms and after all filled up i need to click on a button. Its props are: class: #32770 but what i think will REALLY help me is using its Instance: 55 , that i got with AI3 window info, on the basic control info. all i would need to do is click on that dammit one. the proble about using position is that i may use the AI3 exe on 2 or more comps, all with dif screen resolutions, some even wide screen. any ideas? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 25, 2008 Share Posted September 25, 2008 welll after read, read,and more reading, using search and etc, i still have my doubts of how i could do this.i'm automating some forms and after all filled up i need to click on a button. Its props are:class: #32770but what i think will REALLY help me is using its Instance: 55 , that i got with AI3 window info, on the basic control info.all i would need to do is click on that dammit one.the proble about using position is that i may use the AI3 exe on 2 or more comps, all with dif screen resolutions, some even wide screen.any ideas?I don't know what your native language is, but it might be better if you use that vice whatever online translator you have now... As for your button, it's class is NOT #32770. That is a very common class for Windows popup dialogs, try the Control Tab of AU3Info to get the information for the control. Even better, you might hit Ctrl-Alt-F to freeze the display, then go to the Summary Tab and post the results from that if you need more help. >_< Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SovietGhost Posted September 25, 2008 Author Share Posted September 25, 2008 I don't know what your native language is, but it might be better if you use that vice whatever online translator you have now... As for your button, it's class is NOT #32770. That is a very common class for Windows popup dialogs, try the Control Tab of AU3Info to get the information for the control. Even better, you might hit Ctrl-Alt-F to freeze the display, then go to the Summary Tab and post the results from that if you need more help. >_< just was anooyed for the time... almost 29 hours without sleep... -------------------------------------------------------------- >>>> Window <<<< Title: Cobrança Empresarial Class: #32770 Position: 320, 127 Size: 641, 487 Style: 0x940000C4 ExStyle: 0x00050101 Handle: 0x000B0414 >>>> Control <<<< Class: Static Instance: 55 ClassnameNN: Static55 Advanced (Class): [CLASS:Static; INSTANCE:55] ID: 1074 Text: Position: 264, 455 Size: 109, 18 ControlClick Coords: 78, 7 Style: 0x5000010E ExStyle: 0x00000004 Handle: 0x00100768 >>>> Mouse <<<< Position: 665, 592 Cursor ID: 0 Color: 0xD4CDBB ---------------------------------------------------------------- what is stated at control is the button i need to click for it to save my data on the program. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 25, 2008 Moderators Share Posted September 25, 2008 just was anooyed for the time... almost 29 hours without sleep... -------------------------------------------------------------- >>>> Window <<<< Title: Cobrança Empresarial Class: #32770 Position: 320, 127 Size: 641, 487 Style: 0x940000C4 ExStyle: 0x00050101 Handle: 0x000B0414 >>>> Control <<<< Class: Static Instance: 55 ClassnameNN: Static55 Advanced (Class): [CLASS:Static; INSTANCE:55] ID: 1074 Text: Position: 264, 455 Size: 109, 18 ControlClick Coords: 78, 7 Style: 0x5000010E ExStyle: 0x00000004 Handle: 0x00100768 >>>> Mouse <<<< Position: 665, 592 Cursor ID: 0 Color: 0xD4CDBB ---------------------------------------------------------------- what is stated at control is the button i need to click for it to save my data on the program.Err, that control looks more like a label with a "static" class. Buttons usually have a "Button" class. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SovietGhost Posted September 25, 2008 Author Share Posted September 25, 2008 (edited) Err, that control looks more like a label with a "static" class. Buttons usually have a "Button" class.its a strange program, bank payment generator...is there anyway to mouve move there and click on it?with MouseClick ( "left", 510,577 , 1, 5)was working fine, but as usual, when i try the program on a dif position or resolution it click on the right place, but button isnt there.if theres a way to locate that instance position i can use a variation of that line to click on it. Edited September 25, 2008 by SovietGhost Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 25, 2008 Moderators Share Posted September 25, 2008 its a strange program, bank payment generator...is there anyway to mouve move there and click on it?with MouseClick ( "left", 510,577 , 1, 5)was working fine, but as usual, when i try the program on a dif position or resolution it click on the right place, but button isnt there.if theres a way to locate that instance position i can use a variation of that line to click on it.ControlClick("Cobrança Empresarial", "", "Static55")Try that first. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SovietGhost Posted September 25, 2008 Author Share Posted September 25, 2008 didnt worked. clicked on another place Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 25, 2008 Share Posted September 25, 2008 didnt worked.clicked on another placeIf you are going to click by X/Y, then you have to take into account the option for MouseCoordMode (see help file).Again, I think you missed the target. A "Static" control is equivalent to a "Label" in AutoIt -- it's just text with no onclick event associated with it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SovietGhost Posted September 25, 2008 Author Share Posted September 25, 2008 (edited) If you are going to click by X/Y, then you have to take into account the option for MouseCoordMode (see help file).Again, I think you missed the target. A "Static" control is equivalent to a "Label" in AutoIt -- it's just text with no onclick event associated with it. using the mouse coords worked, but i want the program to find where the so called "button" and click on itedit: workaround ideais there a way of it get that object coords? if so i could use it to get the coords and then the mouseclick to do it. Edited September 25, 2008 by SovietGhost Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 25, 2008 Moderators Share Posted September 25, 2008 (edited) didnt worked.clicked on another placeIf it "clicked" another place, then that is not the right control as I suspected by the name.Edit:To even start to find the "so called" button, you'd need to know what the actual control name of the button is.What app is this, maybe someone can help you further. Edited September 25, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SovietGhost Posted September 26, 2008 Author Share Posted September 26, 2008 If it "clicked" another place, then that is not the right control as I suspected by the name.Edit:To even start to find the "so called" button, you'd need to know what the actual control name of the button is.What app is this, maybe someone can help you further.its a brazilian bank software that generates bills for paymentif wanna try i may send you the installer, its 2.49 mbs Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 26, 2008 Share Posted September 26, 2008 its a brazilian bank software that generates bills for payment if wanna try i may send you the installer, its 2.49 mbs A screen shot should suffice. If you are going to click on it by X/Y coordinates, then use coordinates relative to the application's Window, not the desktop. In most apps, that will remain constant even if you move the window on the desktop. That was what I meant about checking out MouseCoordMode options in the help file. Clicking by X/Y coordinates should not be necessary though, as you should be able to get a proper reference to the control and use ControlClick(), which is MUCH more reliable. I still don't think "Static55" is the correct ID for the button you want. As for retrieving the X/Y coordinates of the control itself, AutoIt can do that, but it still requires the correct control ID, which you don't have yet. If you had an accurate control ID to get the X/Y coordinates with, then you wouldn't need them because you could use ControlClick(). It is also possible that the application produces more than one window, which may throw off you matches. With the application up at the window containing your mystery button, run this from SciTE and post the results: Opt("WinTitleMatchMode", 4) Global $sWinTitle = "Cobrança Empresarial" Global $sWinClass = "#32770" Global $sWinID = "[CLASS:" & $sWinClass & "; TITLE:" & $sWinTitle & "]" Global $avWinList = WinList($sWinID) If $avWinList[0][0] = 0 Then ConsoleWrite("Error! No window matched ID: " & $sWinID & @LF) Exit Else ConsoleWrite("Successfully found " & $avWinList[0][0] & " window(s) matching ID: " & _ $sWinID & @LF) EndIf For $n = 1 To $avWinList[0][0] ConsoleWrite("Listing control classes for: " & $avWinList[$n][0] & _ " (" & $avWinList[$n][1] & ")" & @LF & WinGetClassList($avWinList[$n][1]) & @LF) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SovietGhost Posted September 26, 2008 Author Share Posted September 26, 2008 A screen shot should suffice. If you are going to click on it by X/Y coordinates, then use coordinates relative to the application's Window, not the desktop. In most apps, that will remain constant even if you move the window on the desktop. That was what I meant about checking out MouseCoordMode options in the help file. Clicking by X/Y coordinates should not be necessary though, as you should be able to get a proper reference to the control and use ControlClick(), which is MUCH more reliable. I still don't think "Static55" is the correct ID for the button you want. As for retrieving the X/Y coordinates of the control itself, AutoIt can do that, but it still requires the correct control ID, which you don't have yet. If you had an accurate control ID to get the X/Y coordinates with, then you wouldn't need them because you could use ControlClick(). It is also possible that the application produces more than one window, which may throw off you matches. With the application up at the window containing your mystery button, run this from SciTE and post the results:results: 14:36:30 AU3Check ended.rc:0 >Running:(3.2.12.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\SovietGhost\Desktop\CE - Apoio\ai\CE\teste - Cópia.au3" Successfully found 1 window(s) matching ID: [CLASS:#32770; TITLE:Cobrança Empresarial] Listing control classes for: Cobrança Empresarial (0x00040638) Button Button Button Button Button Static Static Static Static #32770 Static Button Button Button #32770 Static Static Static Static Static ComboBox Static Static Static ComboBox Static Static ComboBox Static Static ComboBox Static Static Edit Static Static Edit Static Static Edit Static Edit Static Static Static Edit Static Static ComboBox Edit Static Static Edit Static Static Edit Static Static Edit Static Edit Static Edit Static Static Edit Static Static Edit Static Static ComboBox Static Static ComboBox Edit Static ComboBox Static Edit Static Edit Static Edit Static Edit Static Edit Static Edit Static Edit Static ComboBox Edit Edit Edit Edit Edit Static Static +>14:36:31 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.609 a ss of the program window: the Incluir is where i need to click if i could use mouse coord to use the coord of the window, not the Windows desktop screen maybe would work too ps: THANKS TO EVERYONE FOR THE HELP, Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 26, 2008 Moderators Share Posted September 26, 2008 How do I download this? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SovietGhost Posted September 26, 2008 Author Share Posted September 26, 2008 How do I download this?i can e-mail or try to host it somewhere.. let me check rapidshare Link to comment Share on other sites More sharing options...
SovietGhost Posted September 26, 2008 Author Share Posted September 26, 2008 http://rapidshare.com/files/148620375/Cobr...sarial.exe.html once you click the button it will give a warning msg, thats why it isnt filled...but at least it mean that its working Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 26, 2008 Moderators Share Posted September 26, 2008 (edited) Oops, no english version!! I have no clue what the website is asking me or what the app is!! lmao. The static control is in fact the pic of the button. Edit: This worked:Local $h_wnd = WinGetHandle("[TITLE:Cobrança Empresarial;CLASS:#32770]") If Not WinActivate($h_wnd) Then WinActivate($h_wnd) Sleep(3000) ControlClick($h_wnd, "", "[CLASS:Static; INSTANCE:55]") Edited September 26, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 26, 2008 Share Posted September 26, 2008 (edited) Hey, we're getting somewhere. Now try this: Global $sWinTitle = "Cobrança Empresarial" Global $sWinClass = "#32770" Global $sWinID = "[CLASS:" & $sWinClass & "; TITLE:" & $sWinTitle & "]" Global $hWinHandle = WinGetHandle($sWinID) Global $sText, $avPos ConsoleWrite(@LF & "Window controls Static55 Details:" & @LF) _GetControlDetails("Static55") ConsoleWrite(@LF & "Window controls ButtonNN Details:" & @LF) For $n = 1 To 99 $sControlID = "[CLASS:Button; INSTANCE:" & $n & "]" _GetControlDetails($sControlID) Next Func _GetControlDetails($iID) $iVis = ControlCommand($hWinHandle, "", $iID, "IsVisible") If @error Then Return 0; @error = invalid window/control Else ConsoleWrite("ClassNameNN = " & $iID & @LF) ConsoleWrite(@TAB & "Visible = " & $iVis & @LF) ConsoleWrite(@TAB & "Enabled = " & ControlCommand($hWinHandle, "", $iID, "IsEnabled") & @LF) ConsoleWrite(@TAB & "Text = " & ControlGetText($hWinHandle, "", $iID) & @LF) $avPos = ControlGetPos($hWinHandle, "", $iID) ConsoleWrite(@TAB & "Pos: X=" & $avPos[0] & " Y=" & $avPos[1] & " W=" & $avPos[2] & " H=" & $avPos[3] & @LF) Return 1 EndIf EndFunc ;==>_GetControlDetails This will display available information about the "Static55" control, and all the "Button" class controls in that GUI. One possibility is you will find that Static55 is at the same coordinates as the associated Button control, which AU3Info doesn't handle well. I have been bitten by "z-ordered" controls before. Please post the results of the above script. Edited September 26, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SovietGhost Posted September 26, 2008 Author Share Posted September 26, 2008 Oops, no english version!! I have no clue what the website is asking me or what the app is!! lmao. The static control is in fact the pic of the button. Edit: This worked:Local $h_wnd = WinGetHandle("[TITLE:Cobrança Empresarial;CLASS:#32770]") If Not WinActivate($h_wnd) Then WinActivate($h_wnd) Sleep(3000) ControlClick($h_wnd, "", "[CLASS:Static; INSTANCE:55]") yes worked... ty vm actually i found some other problems on it... maybe some earlier help would work... but worh the study i had on it...ty all again Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 27, 2008 Share Posted September 27, 2008 yes worked... ty vmRats! I was rooting for the z-order problem! (Glad you got it working.) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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