Solved

Close an application

Posted on 1998-11-15
1
131 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

713 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