Results 1 to 6 of 6

Thread: How to find other VB applications running

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Dallas
    Posts
    3

    How to find other VB applications running

    I have to run a VB application, which should determine if there are two other apps are running and if they are kill them. I know the exe names of the applications that needs to be shut down.

    Thanks in advance

  2. #2
    AIS_DK
    Guest
    Knowing the exe's name doesn't help ypu, what you need is the name of the window or the process, that these two other programs start.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Dallas
    Posts
    3

    I have the window name and the process name

    I do have the window name and the process names is same as exe name. How do I get handle to the app and once I have the handle how do I kill the app
    Thanks

  4. #4
    AIS_DK
    Guest
    It depens rather alot on what kind of program it is. Terminating a program through it's process is never a very good idea, since it doesn't let the program terminate properly.

    Normally you would find the windowhandle, by using the FindWindow API call, using the newlyu found handle, send a the WM_CLOSE message (using the SendMessage API) to the window, this should terminate the window, and hopefully also the program.
    If the program doesn't terminate, then you propoerly have to terminate the process itselft, using the TerminateProcess API call. (This should be your last resort)

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Dallas
    Posts
    3

    I will try that

    Thanks.. I appreciate the help. I will try these options. Hopefully they work

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    All VB forms have classname of ThunderForm, so all you have to do is to enumerate through all windows that have a classname of ThunderForm.

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