Solved

Close an application

Posted on 1998-11-15
1
127 Views
Last Modified: 2010-04-30
If a application is started how can I close it?
The programming language I use is Visual Basic 5.0
I will use API for closing a application.
0
Comment
Question by:danteh
1 Comment
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
Comment Utility
If you are executing the app with Shell, do this:
Dim L as Long
L=Shell("App.Exe", 1)
'Do things
TerminateProcess(L, 0&)

If you don't start the application, and you know it's title, do this:
Dim H as long
H=FindWindow(vbNullString, "Title")
PostMessage(H, WM_CLOSE, 0, 0)

Leave a comment if you need any more help
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now