'Close Application'에 해당되는 글 1건
2007/09/19 08:12
How to Close Another Application by Windows Caption
2007/09/19 08:12 in Borland Delphi

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;
var AppHandle:THandle;
begin
AppHandle:FindWindow(Nil, sCapt) ;
Result:PostMessage(AppHandle, WM_QUIT, 0, 0) ;
end;
Prev

Rss Feed