Function Reference

WinGetProcess

Retrieves the Process ID (PID) associated with a window.

WinGetProcess ( "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 a numeric Process ID (PID).
Failure: Returns -1.

 

Remarks

None.

 

Related

ProcessWait, ProcessWaitClose, ProcessList

 

Example


Run("notepad.exe")
$pid = WinGetProcess("[CLASS:Notepad]")
MsgBox(4096, "PID is", $pid)