Welcome to Geoffrey Swift's βlog. Please subscribe to the Atom feed.


Windows Services in Delphi

The Win32 API methods for the Service Control Manager are powerful but rather unwieldy. Download the Delphi unit service.pas which contains wrapper functions for QueryServiceStatus(), StartService() and ControlService().

See the interface section for the unit below, hopefully it's all self explanatory.

unit service; // Some useful wrapper functions for NT Services. // Geoffrey Swift (c) 2006 interface uses Windows; function GetServiceStatus(const ServiceName: String): DWORD; function StartService(const ServiceName: String; const Wait: Boolean): DWORD; function StopService(const ServiceName: String; const Wait: Boolean): DWORD;

Comments for this post are now closed.