?
Solved

Close Program

Posted on 1998-08-14
3
Medium Priority
?
136 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 30 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

719 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