|
-
Jan 23rd, 2002, 10:11 AM
#1
Thread Starter
New Member
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
-
Jan 23rd, 2002, 11:11 AM
#2
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.
-
Jan 23rd, 2002, 11:20 AM
#3
Thread Starter
New Member
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
-
Jan 23rd, 2002, 11:37 AM
#4
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)
-
Jan 23rd, 2002, 11:46 AM
#5
Thread Starter
New Member
I will try that
Thanks.. I appreciate the help. I will try these options. Hopefully they work
-
Jan 23rd, 2002, 11:53 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|