Search results for 'Close Application'. 1 post(s) found.

  1. 2007/09/19 How to Close Another Application by Windows Caption
2007/09/19 08:12

How to Close Another Application by Windows Caption


To programmatically close another application, send to the application a WM_QUIT message. "Window caption" is the caption of the window that you are sending the message to.

Usage:

if not KillApp('Window caption') then ShowMessage('App not closed') ;

Here's the source code can kill the application by Windows Caption.
function KillApp(const sCapt: PChar) : boolean;
  var AppHandle:THandle;
begin
  AppHandle:=FindWindow(Nil, sCapt) ;
  Result:=PostMessage(AppHandle, WM_QUIT, 0, 0) ;
end;
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 00:01 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 08:13 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:40 delete

    moneyideas