The GetCurrentProcessId function returns the process identifier of the calling process.
DWORD GetCurrentProcessId(VOID)
This function has no parameters.
The return value is the process identifier of the calling process.
Until the process terminates, the process identifier uniquely identifies the process throughout the system.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, GetCurrentProcess, OpenProcess