Results 1 to 5 of 5

Thread: Use VB to close an external Application (Resolved)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8

    Resolved Use VB to close an external Application (Resolved)

    I have got VB to open my file, and run it using the Shell command, but is there a way to make VB close the program I opened after it has finished?

    My program ends up running the same file multiple times, and it would be easier if it could close the program's automatically.


    Any help would be Appreciated


    (P.S. I dont want a code to close the VB application )
    Last edited by bob.11; Nov 9th, 2004 at 02:30 AM.

  2. #2
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    Look into the TerminateProcess API.

    You'll also need to use CreateToolhelp32SnapShot in conjunction with Process32First and Process32Next to retrieve the handle from the process ID (the process ID is the return value of VB's Shell function)

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8
    Thanks. I'll give it a try and get back to you

  4. #4
    Frenzied Member ice_531's Avatar
    Join Date
    Aug 2002
    Location
    Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
    Posts
    1,152
    postmessage

    n tell the window to close


    these simple tasks would be easier on you if you are using the API Guide found at http://allapi.net AND API Spy from http://patorjk.com

    :::`DISCLAIMER`:::
    Do NOT take anything i have posted to be truthful in any way, shape or form.
    Thank You!

    --------------------------------
    "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
    "Finaly I can look as gay as I want..." - NoteMe
    Languages: VB6, BASIC, Java, C#. C++

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8
    Hehehe... Well I got it working, thanks for the advice guys

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