OpenProcess

This function returns a handle to an existing process object.

At a Glance

Header file: Winbase.h
Windows CE versions: 2.0 and later

Syntax

HANDLE OpenProcess( DWORD fdwAccess, BOOL fInherit,
DWORD
IDProcess);

Parameters

dwDesiredAccess

Not supported; set to zero.

bInheritHandle

Not supported; set to FALSE.

dwProcessId

Specifies the process identifier of the process to open.

Return Values

An open handle to the specified process indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

The handle returned by the OpenProcess function can be used in any function that requires a handle to a process, such as the wait functions, provided the appropriate access rights were requested.

When you are finished with the handle, be sure to close it using the CloseHandle function.