WinGetHandle
From AutoIt Wiki
Function Reference
Retrieves the internal handle of a window.
WinGetHandle ( "title" [, "text"] )
Parameters
| title | The title of the window to read. See Title special definition. |
| text | [optional] The text of the window to read. |
Return Value
| Success: | Returns handle to the window. |
| Failure: | Returns "" (blank string) and sets @error to 1 if no window matches the criteria. |
Remarks
This function allows you to use handles to specify windows rather than "title" and "text".
Once you have obtained the handle you can access the required window even if its title changes.
Related
WinSetTitle, GUICreate, WinList
Example
; Identify the Notepad window that contains the text "this one" and get a handle to it
AutoItSetOption("WinTitleMatchMode", 4)
$handle = WinGetHandle("classname=Notepad","this one")
If @error Then
MsgBox(4096,"Error","Could not find the correct window")
Else
ControlSend($handle,"","Edit1","AbCdE")
EndIf