AHK_ControlGet_problem

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

AHK_ControlGet_problem

Post by inseption86 » 16 Jan 2022, 14:39

I can't get Controlget, but if I run Windows Spy, then everything is OK. https://youtu.be/8f2wadETBVY

Code: Select all

DetectHiddenText, on
DetectHiddenWindows, on

IfWinExist, ahk_exe Launcher_Main.exe
{
    ControlGet, OutputVar, Visible,, pushButtonRecordMovie, ahk_class QWidget 
    MsgBox % OutputVar
    return
}
else
 ExitApp


User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: AHK_ControlGet_problem

Post by mikeyww » 16 Jan 2022, 15:50

The control names seem to start with "QWidget" or have names other than "pushButtonRecordMovie".

inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: AHK_ControlGet_problem

Post by inseption86 » 16 Jan 2022, 15:53

mikeyww wrote:
16 Jan 2022, 15:50
The control names seem to start with "QWidget" or have names other than "pushButtonRecordMovie".
why does my script work when I just run win Spy

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: AHK_ControlGet_problem

Post by mikeyww » 16 Jan 2022, 16:02

From viewing the video, it appears that the MsgBox is 1 after you have pressed both the recording button and the other button on the left. Otherwise, the MsgBox is 0 or null, I think.

inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: AHK_ControlGet_problem

Post by inseption86 » 16 Jan 2022, 23:47

mikeyww wrote:
16 Jan 2022, 16:02
From viewing the video, it appears that the MsgBox is 1 after you have pressed both the recording button and the other button on the left. Otherwise, the MsgBox is 0 or null, I think.
I didn’t finish writing the video a bit, before opening WinSpy, I also pressed the buttons in the window, but the Msgbox was empty

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: AHK_ControlGet_problem

Post by mikeyww » 17 Jan 2022, 06:04

I don't think that the issue would have anything to do with Window Spy itself. It might instead relate to the buttons that you are pressing.

If I were debugging this, I would use the control name shown in Window Spy, and would test by pressing one button at a time, rather than two. If it does not work, you could try Acc. viewtopic.php?t=40590

Post Reply

Return to “Ask for Help (v1)”