Jump to content

Need help sending clicks to control


Recommended Posts

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
Advanced (Class):    [CLASS:Button; INSTANCE:16]
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.

Link to comment
Share on other sites

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:


I would try both ways. ...But I'm still a novice with AutoIt. :)  Hope that helps!


Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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")


Link to comment
Share on other sites

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")
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)


Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...