请问在98中怎么获得一个进程的句柄,为什么OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwProcessId)不起作用?返回0x0000001c

解决方案 »

  1.   

    返回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 
      

  2.   

    OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwProcessId)返回0x0000001c是对的,这个问题你好像已经问过一次,你怎么不相信别人,既然不相信别人就不要在这里提问啊:)