Results 1 to 3 of 3

Thread: Terminating a Process

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    19

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Terminating a Process

    Have a look at this thread.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    19

    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
  •  



Click Here to Expand Forum to Full Width