Gets the ID of the control that has keyboard focus in a window.
The handle of the window to access.
A promise that resolves to the ID of the control that has keyboard focus.
import { ControlGetFocusByHandle, WinGetHandle } from '@ahmic/autoit-js';const windowHandle = await WinGetHandle('Untitled - Notepad');const id = await ControlGetFocusByHandle(windowHandle);console.log(id); // Output: "Edit1" Copy
import { ControlGetFocusByHandle, WinGetHandle } from '@ahmic/autoit-js';const windowHandle = await WinGetHandle('Untitled - Notepad');const id = await ControlGetFocusByHandle(windowHandle);console.log(id); // Output: "Edit1"
https://www.autoitscript.com/autoit3/docs/functions/ControlGetFocus.htm
Gets the ID of the control that has keyboard focus in a window.