Returns the ControlRef# of the control that has keyboard focus within a specified window.
ControlGetFocus ( "title" [, "text"] )
| title | Title of window to check. |
| text | [optional] Text from window to check. |
| Success: | Returns the ClassNameNN of the control that has keyboard focus within a specified window. |
| Failure: | Returns "" (blank string) and sets @error to 1 if window is not found. |
Run("notepad.exe")
WinWait("[CLASS:Notepad]")
Local $sControl = ControlGetFocus("[CLASS:Notepad]")
MsgBox(0, "ControlGetFocus Example", "The control that has focus is: " & $sControl)