返回0x0000001c好像已经成功了吧,不成功会返回NULL,下面是MSDN中的解释:The OpenProcess function opens an existing process object. HANDLE OpenProcess( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId );Parameters dwDesiredAccess [in] Access to the process object. This parameter can be one or more of the process access rights. Windows NT/200/XP: This access right is checked against any security descriptor for the process.bInheritHandle [in] If this parameter is TRUE, the handle is inheritable. If the parameter is FALSE, the handle cannot be inherited. dwProcessId [in] Identifier of the process to open. Return Values If the function succeeds, the return value is an open handle to the specified process.If the function fails, the return value is NULL. To get extended error information, call
HANDLE OpenProcess(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
DWORD dwProcessId
);Parameters
dwDesiredAccess
[in] Access to the process object. This parameter can be one or more of the process access rights.
Windows NT/200/XP: This access right is checked against any security descriptor for the process.bInheritHandle
[in] If this parameter is TRUE, the handle is inheritable. If the parameter is FALSE, the handle cannot be inherited.
dwProcessId
[in] Identifier of the process to open.
Return Values
If the function succeeds, the return value is an open handle to the specified process.If the function fails, the return value is NULL. To get extended error information, call