Terminate an application from out a service
From: Bert Prins (prinsoft_at_hotmail.com)
Date: 06/21/04
- Next message: Rob Kennedy: "Re: Question on Free and Nil"
- Previous message: Maarten Wiltink: "Re: Question on Free and Nil"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 21 Jun 2004 15:49:13 +0200
Hallo.
I build a service how starts an application. The same service has to
terminate the same application later on if that application is still
running. I tried the following code, but that doesn't work:
..........
function CloseBatch(Wnd : HWnd) : Boolean; export; stdcall;
var
sCap : array [0..255] of char;
begin
GetWindowText (Wnd, sCap, sizeof(sCap));
if pos ('DOB2000 BATCH', UpperCase(sCap)) > 0 then begin
PostMessage (Wnd, WM_CLOSE, 0, 0);
end;
CloseBatch := true;
end;
begin
DecodeTime(Now, tHour, tMin, tSec, tMSec);
// niet verder gaan als DobBackup al draait
// indien > 20.00 uur dan dobbatch stoppen als die nog loopt
if (tHour >= 20) then begin
EnumWindows(@CloseBatch, 0);
exit;
end;
.......
Can someone help me?
Bert
- Next message: Rob Kennedy: "Re: Question on Free and Nil"
- Previous message: Maarten Wiltink: "Re: Question on Free and Nil"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|