Retrieves the process identifier of the specified process.
DWORD WINAPI GetProcessId(
HANDLE Process
);
Parameters
Process
[in] A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right.
Return Value
If the function succeeds, the return value is the process identifier of the specified process.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Until a process terminates, its process identifier uniquely identifies it on the system. For more information about access rights, see Process Security and Access Rights.
Requirements
Client Requires Windows Vista or Windows XP SP1.
Server Requires Windows Server "Longhorn" or Windows Server 2003.
Header Declared in Winbase.h; include Windows.h.
Library Use Kernel32.lib.
DLL Requires Kernel32.dll.
See Also
GetCurrentProcessId
GetProcessIdOfThread
GetThreadId
Processes