Solved

Close an application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 50
vb6 connector to mongodb 2 50
Convert VB6 MSXML2.ServerXMLHTTP process to C# 2 42
Excel Automation VBA 19 37
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

920 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

17 Experts available now in Live!

Get 1:1 Help Now