WoodGrain

How do I click this button?

6 posts in this topic

#1 ·  Posted (edited)

Hi guys,

Trying to map my mouse button 4 (I'm pretty sure it's 4 rather than 5, but I can experiment) to click the back button in a program (screenshot attached). In terms of positioning it sits in the middle of 3 screens if that makes a difference.

I assume I can use something like (though I prob don't need the 1st two lines if using ControlClick?):

WinActivate("ConnectWise v2016.4 (41139)", "Chrome Legacy Window")
WinWaitActive("ConnectWise v2016.4 (41139)", "Chrome Legacy Window")
ControlClick("ConnectWise v2016.4 (41139)", "Chrome Legacy Window", "[CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1]", "Left", 1, 0, 30)

When I hover my mouse over the button I get the following information in Window Info

>>>> Window <<<<
Title:  ConnectWise v2016.4 (41139)
Class:  TabBrowser_MainFrame
Position:   -8, -8
Size:   1696, 1026
Style:  0x17CF0000
ExStyle:    0x00040100
Handle: 0x0000000000010C56

>>>> Control <<<<
Class:  Chrome_RenderWidgetHostHWND
Instance:   1
ClassnameNN:    Chrome_RenderWidgetHostHWND1
Name:   
Advanced (Class):   [CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1]
ID: 315622768
Text:   Chrome Legacy Window
Position:   0, 30
Size:   1680, 957
ControlClick Coords:    81, 138
Style:  0x56300000
ExStyle:    0x00000020
Handle: 0x0000000000040AC6

>>>> Mouse <<<<
Position:   81, 191
Cursor ID:  0
Color:  0x004E7F

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
ConnectWise: My Calendar
Chrome Legacy Window


>>>> Hidden Text <<<<
Chrome Legacy Window

 

Back Button.jpg

Edited by WoodGrain
Additional information.

Share this post


Link to post
Share on other sites



You are using x,y params wrong, when used the coords must be the

ControlClick Coords:    81, 138

not the absolut MousePos coords.

Share this post


Link to post
Share on other sites

That should have been so obvious given the position of the button was not anywhere near 0, 30 lol. TBH, I had some issues figuring out the controlID, turns out the above was correct by using the "Advanced (Class)", so while I was posting I was trying to figure that out more so than the coords.

Those coords work, all working now, thanks AB

Share this post


Link to post
Share on other sites

Hmm, ok, so it's not working again, looks like the contolID is different...

Can someone advise what I can use in the ControlID field of the ControlClick()?

>>>> Window <<<<
Title:  ConnectWise v2016.4 (41139)
Class:  TabBrowser_MainFrame
Position:   -8, -8
Size:   1696, 1026
Style:  0x17CF0000
ExStyle:    0x00040100
Handle: 0x0000000000010C56

>>>> Control <<<<
Class:  Chrome_RenderWidgetHostHWND
Instance:   2
ClassnameNN:    Chrome_RenderWidgetHostHWND2
Name:   
Advanced (Class):   [CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:2]
ID: 314454488
Text:   Chrome Legacy Window
Position:   0, 30
Size:   1680, 957
ControlClick Coords:    81, 140
Style:  0x56300000
ExStyle:    0x00000020
Handle: 0x0000000000050980

>>>> Mouse <<<<
Position:   81, 193
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
ConnectWise: My Calendar
Chrome Legacy Window


>>>> Hidden Text <<<<
Chrome Legacy Window

 

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • FMS
      Winmove GUI moves buttons
      By FMS
      Hello,
      Below is a code whish i made for this problem i've. (code 1)
      The problem is that iff i try Winmove to to show the hidden button it's not working as i tought.
      What i try to do is just simple expand the GUI to make the hidden button visible. (code 2)
      I've already looked into GUICoordMode but don't think that's the problem.(or I don't understand it properly)
      Also tried to look into the forum but din't find anything around this subject but could't find anything around this subject.
      Does somebody knows what I'm doing wrong?
       
      Code 1 (winmove prblem) :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 134, 103, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $expand_button WinMove($Form1, "From1", 192, 124, 300, 103) EndSwitch WEnd  
      Code 2 What I'm trying to expand to :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 265, 114, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
    • pinkfoyd
      [SOLVED] Reverse state of button
      By pinkfoyd
      Hi,
       
      I remember a script where i had seen an user inverse state of a button ( $GUI_ENABLE (64)   /  $GUI_DISABLE (128) ) in one line only
      I remember it use Bit operation but i cannot reproduce it, can someone help ?
       
      In fact if the button is enable i want to disable it and if he is disable , want to enable it, something like that :
       
      GuiCtrlSetState ( $button , BitOr ( GuiCtrlGetSate ( $button ) )        ; i know this is NOT working, for explanation only
       
       
      Thanks !
    • Queener
      Click on Toolbar icon
      By Queener
      This is the info of the interface:
      Window
      Title:    Password Safe
      Class:    #32770
      Control
      Class:    ToolbarWindow32
      Instance:    2
      ClassnameNN:    ToolbarWindow322
      Name:    
      Advanced (Class):    [CLASS:ToolbarWindow32; INSTANCE:2]
       ToolsBar
      1:    32003    Make New Database
      2:    32002    Open Another Database
      3:    32004    Close Database
      4:    32005    Save Database
      5:    0    
      6:    32066    Copy Password to Clipboard
      7:    32068    Copy Username to Clipboard
      8:    32069    Copy Notes to Clipboard
      9:    32065    Clear the clipboard contents
      10:    0    
       
      I wanted to click on 1:    32003    Make New Database. But unfortunately, I'm unable to click on that. Any help is much appreciated. Below are the code I tried:

      $Title = "Password Safe" $Class = "[CLASS:ToolbarWindow32; INSTANCE:2]" WinWaitActive($Title) Sleep(500) Dim $hWnd = WinGetHandle($Title,"") Dim $hToolBar = ControlGetHandle($hWnd, '', $Class) ConsoleWrite($hWnd & @TAB & $hToolBar & @LF) _GUICtrlToolbar_ClickIndex($hToolBar, 32003)
    • Sucre
      Get .Net WinForm Application ToolTip Control
      By Sucre
      I turned to Autoit from AHK just because it support WinForm Application so well. The problem often haunts me that all the application in my job is WinForm. And it indeed help my work so much. Great thanks in advance.
      However, I can't get the ToolTip text in the application of my company. Specifically,now I want to get the information about some data, however the information is all displayed in the tooltip on the scatter diagram which is made of those data.
      Is there any advice ? Relative topics I have searched can't get any information about the winform tooltip...
       
    • cookiemonster
      Can't click button after show window
      By cookiemonster
      I have a window with two buttons, when i click the second button it shows a new window and hides the orgional window, when you click close on the second window, it hides the second window and shows the first one again, but now on the first one I can click the buttons but they no longer do anything, why is this?