Results 1 to 8 of 8

Thread: Difficulty- Extreme( Need help with shutting down a program in NT)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Exclamation

    I am writing a program for windows NT that will close an exe(when it is running I have the hwnd for it). I have tried the terminateprocess command but it is not working. Does the code for terminate process vary in NT. I am pretty sure it does, but not 100%. If it doesn't, could you give a detailed description of what the parameters are that are sent.

    thank you for your time,
    Joe

    If anything is confusing please post and tell me to clarify.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You run into lots of problems? Are you making an OS or something in Visual Basic? Unfortunately, I don't have NT, so I can't help you. But I would guess TerminateProcess would work, if you got the handle of the window with Findwindow. If you don't know the class-name, you can use SPY++ which comes with VS6 to find it.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Exclamation Not quite

    I am making a program that is able to close down programs from any device(almost like a program for ctrl alt delete with a few little twists).

    Thanks anyway. Could you possibly describe to me about what has to be sent when you use TerminateProcess?

    Joe

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I've never used terminateprocess myself, but there was one on this Q + A once. I'll do a search.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Thumbs up


    http://forums.vb-world.net/showthrea...threadid=25427

    Sam Finch shows us how.

    And for the hWnd, use findwindow to get the hWnd. Example:

    hWnd = FindWindow("IEFrame",vbNullString)

    That would get the handle of Internet Explorer. I'm sure there's a process which lets us enumerate all of the available hWnds, because it's in Spy++. Anyway, hope I helped, see ya.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    And here:

    http://forums.vb-world.net/showthrea...threadid=25871

    Is the code to enumerate all available windows. Enjoy!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Exclamation I have tried the code for both before to no avail.

    I have searched and found those threads before. Unfortunately, that code doesn't seem to work with NT. Maybe I am doing something wrong. Could you explain what each variable does that is being sent and a list of possible values?

    thank you for your help,
    Joe

  8. #8
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    I posted that enumeration code, it does work in NT, because the person who asked for it used NT. I don't know about TerminateProccess. goto www.vbapi.com. Thats were i got the code

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