|
-
Mar 28th, 2007, 12:47 PM
#1
Thread Starter
Junior Member
Terminating a Process
Is there a way to terminate a process that hasn't been opened by VB?
Right now I need to shell an application, and the application in turn is opening several applications that need to all be closed individually using VB.
I found this:
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
But I'm not sure how to find out the hProcess, I know you can receive a return value from a shell, but right now I simply need to find out how to end a process without opening it first. I also tried closing the window, but that didn't work right as the application freezes, so I must end the process.
-
Mar 28th, 2007, 12:49 PM
#2
Re: Terminating a Process
Have a look at this thread.
-
Mar 28th, 2007, 02:46 PM
#3
Thread Starter
Junior Member
Re: Terminating a Process
For some reason that code doesn't seem to be working. I tried it with calculator and it isn't doing a thing. I stuck the Type declarations in a module and changed the Declare Functions to Private and it doesn't do a thing.
I'm kinda stumped.
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
|