|
-
Aug 17th, 2001, 04:19 AM
#1
Thread Starter
Lively Member
Terminate a Process
Can anyone tell me how to find a process ID and terminate it?
-
Aug 17th, 2001, 04:46 AM
#2
Frenzied Member
GetCurrentProcessId and the GetCurrentProcess API's. Then use the TerminateProcess API to terminate it.
-
Aug 17th, 2001, 04:46 AM
#3
Frenzied Member
Declare Function TerminateProcess Lib "kernel32" Alias "TerminateProcess" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
· hProcess
Identifies the process to terminate.
Windows NT: The handle must have PROCESS_TERMINATE access. For more information, see Process Objects.
· uExitCode
Specifies the exit code for the process and for all threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process’s exit value. Use the GetExitCodeThread function to retrieve a thread’s exit value.
Declare Function GetCurrentProcessId Lib "kernel32" Alias "GetCurrentProcessId" () As Long
Declare Function GetCurrentProcess Lib "kernel32" Alias "GetCurrentProcess" () As Long
-
Aug 17th, 2001, 04:57 AM
#4
Thread Starter
Lively Member
But I dont want to terminate the current Process. For example, I run Vb application. In this application, I open Excel . The current process is my Application but I want to Terminate Excel.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|