User32GetWindowThreadProcessId(IntPtr, Int32) Method

Retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static int GetWindowThreadProcessId(
	IntPtr hWnd,
	out int refPid
)

Parameters

hWnd  IntPtr
A IntPtr handle to the window.
refPid  Int32
A pointer to a variable that receives the process identifier (PID).

If this parameter is not , GetWindowThreadProcessId(IntPtr, Int32) copies the identifier of the process to the variable; otherwise, it does not.

Return Value

Int32
The identifier of the thread that created the window.

Remarks

See Also