How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulation? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
omareg94
Posts: 94
Joined: 27 Jun 2016, 22:46

How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulation?

25 Mar 2017, 06:46

How could I push down (click) a dialog button within a background window without using Keyboard/Mouse key click simulation?

I've used AccViewer to determine the path of the button (4.2):
Image

How could I click the button without simulating Keyboard/Mouse key click and push it directly?

What I've tried but not working:

Code: Select all

; Example 1 (Not working):
WinMenuSelectItem, Current Time (with Milliseconds)BBB, , 4&, 2&
; Example 2 (Not working):
ControlClick, Get Time, Current Time (with Milliseconds)BBB, , Left, 1
; Example 3 (Not working):
BtnClick("Get Time", "Current Time (with Milliseconds)BBB ahk_class QWidget ahk_exe vlc.exe")
; Example 4 (Not working):
BtnClick("Button1", "Current Time (with Milliseconds)BBB ahk_class QWidget ahk_exe vlc.exe")
In Example 3, and 4 I think that BtnClick isn't working also because the ClassNN of the button seems wrong as I'm not able to capture it via Window Spy or AccViewer.
Last edited by omareg94 on 25 Mar 2017, 23:23, edited 2 times in total.
omareg94
Posts: 94
Joined: 27 Jun 2016, 22:46

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati

25 Mar 2017, 21:40

@Helgef (reply):

Thanks Helgef.

I've tried these, but they are not working:

Code: Select all

; Example 3 (Not working):
BtnClick("Get Time", "Current Time (with Milliseconds)BBB ahk_class QWidget ahk_exe vlc.exe")
; Example 4 (Not working):
BtnClick("Button1", "Current Time (with Milliseconds)BBB ahk_class QWidget ahk_exe vlc.exe")
I think they aren't working because the ClassNN of the button seems wrong as I'm not able to capture it via Window Spy or AccViewer.

I need help to make BtnClick work with that case. (A question on BtnClick's main thread)
Last edited by omareg94 on 25 Mar 2017, 23:22, edited 1 time in total.
User avatar
boiler
Posts: 16920
Joined: 21 Dec 2014, 02:44

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati

25 Mar 2017, 22:53

You have to put literal strings inside quotation marks when passing them as parameters to a function (expression format).

Example:
MyFunction("this is a string I'm passing as a parameter", "this is the next parameter")
User avatar
boiler
Posts: 16920
Joined: 21 Dec 2014, 02:44

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati

26 Mar 2017, 05:56

I don't see where you've found that the ClassNN control name for the button is Button1. Maybe it is, but did you actually find that to be the case?
User avatar
boiler
Posts: 16920
Joined: 21 Dec 2014, 02:44

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati

26 Mar 2017, 09:36

Then use the Window Spy tool and hover over that control and see what it says it is.
User avatar
boiler
Posts: 16920
Joined: 21 Dec 2014, 02:44

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati

26 Mar 2017, 18:54

Since it apparently doesn't have a ClassNN control name, I don't think you can use that BtnClick function. And this may be a case where that control is not clickable without activating that window, as it often is.
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: How could I push down (click) a dialog button within a background window without using Keyboard/Mouse click simulati  Topic is solved

28 Mar 2017, 12:01

omareg94 wrote: How could I click the button without simulating Keyboard/Mouse key click and push it directly?
If AccViewer is picking up the button, then have you considered trying Acc.ahk? :)

Get the path of the button relative to the window hosting it (using AccViewer, point the crosshairs at the window itself, navigate through the tree until you find the button and copy the path presented at the bottom of AccViewer) and then see if something like this works:

Acc_Get("DoDefaultAction", "correct path goes here",, "Current Time (with Milliseconds)BBB ahk_class QWidget ahk_exe vlc.exe")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, ArkuS, Stpham and 120 guests