Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Close an application

Posted on 1998-11-15
1
Medium Priority
?
135 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 200 total points
ID: 1444955
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

972 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