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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing an outside application from within a vb program, on complete.

Status
Not open for further replies.

tommy19

Programmer
Aug 23, 2001
49
US
I need to find a way to close an outside window, when the process is complete from within a VB application. I am opening the program with AppActivate. And I need to close it when the backup process is finished. The program is "MS Backup". Is this possible? Thanks for any help!!!
Tommy
 
Kill will terminate a process, almost as if you did a cntl+alt+del then end task...this is not a very safe or efficient way to go about it...Look through your help files on appactivate and see if there are related topics, I'm pretty sure there's a function to complete the process...There are also functions to send data directly to the other program...if it's a VB program this would be fairly simple, and you'll be able to use a simple function.end line, or something along those lines...

Good luck, hope this helps,
Rob
 
The only kill command in VB is used to delete files, not to kill processes.

What you may be interested in is:
[tt]
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
[/tt]

You need to know the process handle in the first place, but there are plenty of threads in this forum that discuss how to do that using ShellExecute (and related methods). Just do a search.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top