Method ControlGetFocus

AutoIt X

Method Reference


ControlGetFocus

Returns the ControlRef# of the control that has keyboard focus within a specified window

ControlGetFocus "title" [, "text"]

Parameters

title Title of window to check.
text Optional: Text from window to check.

Return Value

Success: Returns ControlRef# of the control that has keyboard focus within a specified window.
Failure: Returns a blank string and sets oAutoIt.error to 1 if window is not found.

Related

ControlCommand, ControlFocus, WinActive

Example


Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
a = oAutoIt.ControlGetFocus("Untitled - Notepad")