Solved

Close Program

Posted on 1998-08-14
3
135 Views
Last Modified: 2010-04-04
How to close a external program, that means not a program created in delph, but ex. notebook.exe or something
0
Comment
Question by:koger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
BoRiS earned 10 total points
ID: 1362108
koger

PostMessage(FindWindow(Nil, 'window caption'), WM_QUIT, 0, 0);

 Where "window caption" is the caption of the window that you
 are wanting to close...

Later
BoRiS
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362109
What Boris told you is correct, but you can also use

SendMessage(FindWindow(Nil, 'Untitled - Notepad'),WM_CLOSE,0,0);//SendMessage

since sendmessage, doesn't leave it until it is send to the app, or whatever you are sending to...

Regards,
Viktor Ivanov
0
 

Author Comment

by:koger
ID: 1362110
Great, but I don't know the Caption, but I know the path and filename of the program I want to close, is it perhaps possible somehow to extract the caption from a filename?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

617 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