Jump to content
Sign in to follow this  
Wingens

Not able to click on button in a setup

Recommended Posts

Wingens

Hi i am trying to click on the next button in a setup that i need to use, only problem is it is not responding. Below the code and the info:

$TITLE = "Setup - Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista"
        $SUB = "Welcome to the Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista Setup Wizard"
            WinWait($TITLE, $SUB)
            If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB)
            WinActive($TITLE, $SUB)
            Sleep(100)
            ControlClick($TITLE, $SUB, "[ID:264262]")
            Sleep(100)
            ControlClick($TITLE, $SUB, "button1")
            Sleep(100)
            ControlClick($TITLE, $SUB, "TNewButton:1")
            Sleep(100)
            ControlClick($TITLE, $SUB, "TNewButton1")
            Sleep(100)
            ControlClick($TITLE, $SUB, "[CLASS:TNewButton; INSTANCE:1]")
            Sleep(100)
            ControlClick($TITLE, $SUB, "[CLASSNN:TNewButton1]")
            Sleep(100)
            Send("{enter}")
            Sleep(100)
            ControlSend($TITLE, $SUB, "", "{enter}")

I tried every way i could think of to click on the next button.

Probably a couple of stupid attemds but you cant blame me for trying.

>>>> Window <<<<
Title:  Setup - Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista
Class:  TWizardForm
Position:   2219, 415
Size:   503, 389
Style:  0x16CA0000
ExStyle:    0x00010100
Handle: 0x00000000001F066E

>>>> Control <<<<
Class:  TNewButton
Instance:   1
ClassnameNN:    TNewButton1
Name:   
Advanced (Class):   [CLASS:TNewButton; INSTANCE:1]
ID: 461326
Text:   &Next >
Position:   327, 327
Size:   75, 23
ControlClick Coords:    29, 14
Style:  0x54010001
ExStyle:    0x00000000
Handle: 0x0000000000070A0E

>>>> Mouse <<<<
Position:   2578, 782
Cursor ID:  0
Color:  0xE8E8E8

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Welcome to the Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista Setup Wizard

This will install Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista version 1.10.0.0 on your computer.

It is recommended that you close all other applications before continuing.

Click Next to continue, or Cancel to exit Setup.
&Next >
Cancel

Hope you guys can point me in the right direction...

*EDIT*: After posting i see that the ID of the button changed, that is strainge and don't blame my wrong number in the script please :P

Edited by Wingens

Share this post


Link to post
Share on other sites
Wingens

stupid me, did not try that!

Thank you so much

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • Tats
      By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
    • Pike
      By Pike
      Hello Everyone,
      New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
      1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
      2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!
      Pike
    • MaximusCZ
      By MaximusCZ
      Hello, and apologies if this have been discussed before, but I googled and couldnt find anything relevant.
      I have a problem where I try to send a control clink into to a window. 
      Part of window I try to send clicks to looks like this . The black border is showing when I mouse over it Au3Info, I get following information:

      I am testing its interaction with code

      The result I get is that it makes control clicks trough first line, opens and closes menus, as expected.
      When It gets to second line, it does not click a single icon. I can tell that coords are correct as the dropdown menus (No view active) gets focused(altough not rolled out). Same behaviour happens if roughly 40<y<60, so I know I am hitting good height. You can look at how it behaves here: output.webm 
      Dropdown 1 focuses at around 8 sec mark, and 13 sec mark it changes to second dropdown, defocusing first one, seemingly not registering any clinks inbetween.
       
      Have you ever encountered similar behaviour? I need to click the Key button, first on second line, with controlclick (or any other way not hijacking the mouse). I cant trigger that button by keyboard and There is no other control having control over it.
      Help
       
    • kcvinu
      By kcvinu
      Hi all,
      I have a button created with _GUICtrlButton_Create function. I know that this function returns a handle of button instead of an ID. So i have obtain control ID by calling _WinAPI_GetDlgCtrlID function. After that i have tried the GUICtrlSetBkColor function. But it didnt worked. Any suggestions will be appreciated. Thanks in advance. 
      Note : - The window which carries this button is not created with native gui create function. Instead, it is created with CreateWindowEx api function.
×