amadorc Posted September 22, 2016 Posted September 22, 2016 For the life of me, I can't get any data from this button. I'm hoping it's something simple I'm overlooking. I'm trying to click this button: >>>> Window <<<< Title: Gameshow - Welcome Class: eva::0x2903 Position: 586, 95 Size: 636, 679 Style: 0x16CF0000 ExStyle: 0x00040300 Handle: 0x000000000030088A >>>> Control <<<< Class: Button Instance: 16 ClassnameNN: Button16 Name: Advanced (Class): [CLASS:Button; INSTANCE:16] ID: Text: Next Position: 508, 603 Size: 100, 25 ControlClick Coords: 79, 11 Style: 0x52000000 ExStyle: 0x00000000 Handle: 0x00000000001007A6 >>>> Mouse <<<< Position: 1177, 736 Cursor ID: 0 This is what the function looks like in my program: ControlClick("Gameshow - Welcome", "" ,"[CLASS:Button; TEXT:Next; INSTANCE:16]") It returns 0 (error) when I try to use ControlClick. I've tried multiple other functions to gather data from this control but none of them work. I've tried elevating permissions of the application and the script as well.
amadorc Posted September 22, 2016 Author Posted September 22, 2016 And by "data" I mean anything indicating the script recognizes its existence..
bloopie Posted September 22, 2016 Posted September 22, 2016 Hello amadorc, Have you tried using only the "Advanced" portion? ...Maybe like this: ControlClick("Gameshow - Welcome", "", "[CLASS:Button; INSTANCE:16]") I've always had good luck with using only the Advanced line with ControlClick. ...But this one looks a little weird because most (if not all) of the Advanced lines I've used, have all had no spaces around the semicolons...as in: [CLASS:Button;INSTANCE:16] I would try both ways. ...But I'm still a novice with AutoIt. Hope that helps! bloopie Malware Response Instructor @ BC
amadorc Posted September 22, 2016 Author Posted September 22, 2016 Just tried without the whitespace (no space around semicolons) and without the text parameter, still no change. Appreciate the help
amadorc Posted September 22, 2016 Author Posted September 22, 2016 Update: Workaround is using the IUIAutomation MS Framework to find the control, still not as clean as I'd like it to be but it works.
Bert Posted September 23, 2016 Posted September 23, 2016 amadroc and bloopie - Both of you are new so you need to know this - Game automation is not permitted to be discussed in the AutoIt forum. Please see the forum rules if you have any questions on this. Thanks. If you have a issue that falls within forum rules - we are more than happy to help. To the both of you - have a great weekend. Cheers! Bert The Vollatran project My blog: http://www.vollysinterestingshit.com/
amadorc Posted September 23, 2016 Author Posted September 23, 2016 Wasn't a game, Gameshow is a streaming application.
Danyfirex Posted September 23, 2016 Posted September 23, 2016 Hello. Do something like this to check that windows/controls exist. Local $hGameshow = WinGetHandle("Gameshow - Welcome") ConsoleWrite("hGameshow: " & $hGameshow & @CRLF) ConsoleWrite("hButton: " & ControlGetHandle($hGameshow,"","Button16") & @CRLF) ControlClick($hGameshow, "", "Button16") Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
amadorc Posted September 23, 2016 Author Posted September 23, 2016 Hey Danyfirex, Yes this was the console output hGameshow: 0x0003079C hButton: 0x0004078E Which is identifying the handles of the control/window.
Danyfirex Posted September 23, 2016 Posted September 23, 2016 I don't have time to check deeply why that control does not get controlclick event. but You can do using control position. Local $hGameshow = WinGetHandle("Gameshow - Welcome") WinActivate($hGameshow) ConsoleWrite("hGameshow: " & $hGameshow & @CRLF) Local $hControl = ControlGetHandle($hGameshow, "", "Button16") ConsoleWrite("hButton: " & $hControl & @CRLF) Local $aPos = ControlGetPos($hGameshow, "", $hControl) Local $WindowPos = WinGetPos($hGameshow) Local $iX = $aPos[0] + $WindowPos[0] + 30 Local $iY = $aPos[1] + $WindowPos[1] + 30 MouseMove($iX, $iY, 0) MouseClick("left") Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
junkew Posted September 25, 2016 Posted September 25, 2016 @Amadorc: What would you like to see cleaner in IUIAutomation framework? FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
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