How to terminate a process 
Author Message
 How to terminate a process

Hi,
Could someone tell me how to terminate a process?  Below is a snippet of the
code.  I have traced through it.  The call to CreateProcess() is successful
but the call to TerminateProcess() failed.  I need to create the process in
DEBUG_PROCESS mode because I'm trying to capture debug events.  Thanks.

 memset(&ProcInfo, 0x0, sizeof(ProcInfo));
 BOOL bRet = CreateProcess(bstrAppName, L"", NULL, NULL, NULL,
                                DEBUG_PROCESS, NULL, NULL, NULL, &ProcInfo);
 BOOL bSuccess = TerminateProcess(ProcInfo.hProcess, 1);
 if(!bSuccess)
 {
    long lRet = GetLastError();
    CloseHandle(ProcInfo.hProcess);
    return E_FAIL;
 }



Sun, 11 May 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Find and terminate a process under WIN98

2. How to terminate a process

3. How to terminate a Process by Name ??

4. How to terminate a process?

5. About terminate a process:

6. How to terminate a process created with CreateProcess(...)

7. Cannot terminate a process.

8. How to terminate a process?

9. How do I terminate a process that I created

10. How to terminate a Process by Name ??

11. (Q) How to terminate a Process

12. How to terminate child process when calling process exits?

 

 
Powered by phpBB® Forum Software