次の方法で共有


OpenProcess (Compact 2013)

3/28/2014

This function returns a handle to an existing process object. When you finish with the handle, close it using the CloseHandle function.

Syntax

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

Parameters

  • fdwAccess
    [in] Not supported; set to zero.
  • fInherit
    [in] Not supported; set to FALSE.
  • IDProcess
    [in] Specifies the process identifier of the process to open.

Return Value

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 wait functions, if the appropriate access rights are requested. An untrusted process cannot get a handle to a trusted process.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

Process and Thread Functions
CreateProcess
GetCurrentProcessId

Other Resources

CloseHandle