Wenn du Delphi7 Enterprice noch hast dann erstelle einfach damit den Service
(File->New->Other->Service Application) und übernehme den Quelltext zur weiteren Bearbeitung nach Delphi2005.
Projektdatei:
Delphi-Quellcode:
program Project1;
uses
SvcMgr,
Unit1 in 'Unit1.pas' {Service1: TService};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TService1, Service1);
Application.Run;
end.
Unit1:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr, Dialogs;
type
TService1 =
class(TService)
private
{ Private declarations }
public
function GetServiceController: TServiceController;
override;
{ Public declarations }
end;
var
Service1: TService1;
implementation
{$R *.DFM}
procedure ServiceController(CtrlCode: DWord);
stdcall;
begin
Service1.Controller(CtrlCode);
end;
function TService1.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
end.