Expand Minimize

GetCurrentProcessId function

Retrieves the process identifier of the calling process.

Syntax


DWORD WINAPI GetCurrentProcessId(void);

Parameters

This function has no parameters.

Return value

The return value is the process identifier of the calling process.

Remarks

Until the process terminates, the process identifier uniquely identifies the process throughout the system.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

WinBase.h on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Processthreadsapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

GetCurrentProcess
OpenProcess
Process and Thread Functions
Processes

 

 

Community Additions

ADD
Show:
© 2014 Microsoft