Solved

Close an application

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

789 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