W
wp231957
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr, Dialogs,
ExtCtrls;
type
TService2 = class(TService)
Timer1: TTimer;
procedure ServiceStart(Sender: TService; var Started: Boolean);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
function GetServiceController: TServiceController; override;
{ Public declarations }
end;
var
Service2: TService2;
implementation
{$R *.DFM}
procedure ServiceController(CtrlCode: DWord); stdcall;
begin
Service2.Controller(CtrlCode);
end;
function TService2.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
procedure TService2.ServiceStart(Sender: TService; var Started: Boolean);
begin
timer1.Enabled:=true ;
end;
procedure TService2.Timer1Timer(Sender: TObject);
begin
showmessage('ok');
end;
end.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr, Dialogs,
ExtCtrls;
type
TService2 = class(TService)
Timer1: TTimer;
procedure ServiceStart(Sender: TService; var Started: Boolean);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
function GetServiceController: TServiceController; override;
{ Public declarations }
end;
var
Service2: TService2;
implementation
{$R *.DFM}
procedure ServiceController(CtrlCode: DWord); stdcall;
begin
Service2.Controller(CtrlCode);
end;
function TService2.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
procedure TService2.ServiceStart(Sender: TService; var Started: Boolean);
begin
timer1.Enabled:=true ;
end;
procedure TService2.Timer1Timer(Sender: TObject);
begin
showmessage('ok');
end;
end.