Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do Ikill an .exe launched as a VB reference? 1

Status
Not open for further replies.

fuzzword

Programmer
Jul 24, 2001
8
US
Hi all,

I have a third-party .exe which is supposed to be set up as a reference in the VB project. It works great, except that it does not unlaod after the VB executable terminates, and the object itself has no properties to terminate it.

Any suggestions? I'm assuming this will take a couple APIs of some sort.

Thanks!
 
Have you tried using the Add-In manager? It might help you out.
 
Thanks for replying!

But it's not an add-in, and doesn't work as one. Basically what I'm looking for specifically is code to locate and kill a running executable (.exe); by the way, it shows up as a process that runs under ntvdm.exe, if that helps. It does not show up in the task list.

help!
 
I found this link: that may help you out. It lists a couple of APIs you can choose from to end a process, and how to use them. I think SendMessage(WM_CLOSE) may be an option, but I would try to stay away from TerminateProcess() API if at all possible, I understand it's gotten some bad reviews lately (in some cases for good reason). Of course, this is considering you don't have an object reference to the exe to kill, and assuming you can get the hWnd or ProcessID of the app (hopefully).

Hope that helps!

~Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top