ahk_control?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
knn
Posts: 30
Joined: 30 Mar 2020, 20:35

ahk_control?

02 May 2020, 14:23

Is it possible to get the name of the currently active control?

Something like ctrlname := WinGetControl("A") or WinGet, ctrlname, Control, ahk_id %hwnd% and it would return "Scintilla1" or "Edit2" or so?

I know that you can use Window Spy, and I know that you can get a list of all control names with WinGet, ctrlist, ControlList..., but I want to find out programmatically the name of the controler the cursor is in.
User avatar
boiler
Posts: 17387
Joined: 21 Dec 2014, 02:44

Re: ahk_control?

02 May 2020, 14:35

Use ControlGetFocus, specifying A for the WinTitle parameter.
knn
Posts: 30
Joined: 30 Mar 2020, 20:35

Re: ahk_control?

02 May 2020, 14:57

Thank you!!! That's what I was looking for.

However, when I do it in Firefox's or Opera's URL bar, it shows nothing. Hmmm :think:
User avatar
boiler
Posts: 17387
Joined: 21 Dec 2014, 02:44

Re: ahk_control?

02 May 2020, 15:01

If you can't see it with the Window Spy tool, then you aren't going to get it programmatically either. It doesn't use addressable controls.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Kodakku and 373 guests