Converts an expression into an HWND handle.
HWnd ( expression )
Parameters
| expression | An expression to convert into an HWND handle. |
Return Value
| Success: | If the value can be converted to an HWND, the HWND representation will be returned. |
| Failure: | If the HWND does not denote a valid window, a 0 (NULL) HWND will be returned and @error set to 1. |
Remarks
Double numbers can not be converted to an HWND.
Related
Int, String, Number, Ptr
Example
Run("notepad.exe")
WinWait("[CLASS:Notepad]")
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
Local $sHWND = String($hWnd) ; Convert to a string
WinSetState(HWnd($sHWND), "", @SW_MINIMIZE)
Sleep(5000) ; Notepad should be minimized
WinClose(HWnd($sHWND))