Results 1 to 5 of 5

Thread: [solved]Problem with terminating process

  1. #1

    Thread Starter
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442

    [solved]Problem with terminating process

    I use the following classfile to enum windows processes (see attached), but i cant find a way to teminate a process. i Tried to kill it by ProcessID (th32ProcessID) with the TerminateProcess api, but no succes. Anyone got an idea of what i am doing wrong?

    Or got an exaple how to terminate applications, with this class file?
    Attached Files Attached Files
    Last edited by phrozeman; Apr 7th, 2003 at 07:43 AM.
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  2. #2

    Thread Starter
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442
    *bump*
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  3. #3

    Thread Starter
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442
    Nevermind, found it:

    VB Code:
    1. Dim hProcess As Long, lExitCode As Long
    2.     hProcess = OpenProcess(PROCESS_TERMINATE, False, Split(List1.Text, " - ")(0))
    3.     Call TerminateProcess(hProcess, lExitCode)
    4.     Call CloseHandle(hProcess)
    5.     Text1.Text = hProcess
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  4. #4
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Cheers dude for posting the answer, even though no-one actually replied. It's very rare that happens...Cheers again...It's exactally what I was looking for...

    Adios,

    Woka

  5. #5
    Fanatic Member MikkyThomeon's Avatar
    Join Date
    Oct 2002
    Location
    At work...
    Posts
    648
    Running on a win98 machine, the processid's appear as negative numbers. Is this OK???? I would assume the values from the processid are being shown as negative values because of some buffer overflow, but could be wrong.

    Any ideas???

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