DD Service Application Framework
Download Latest DDService
DDService is an enhanced Windows NT service application framework for Delphi and C++ Builder based on the original VCL service framework. In addition to it it also encapsulates new Windows NT service APIs introduced since Windows 2000. DDService is freeware with source and currently supports Delphi 5, 7 and 2006 to XE8, 10 Seattle, 10.1 Berlin, 10.2 Tokyo and 10.3 Rio, as well as C++ Builder 2006 to XE5.
Original author, the late Arno Garrels of Duodata in Berlin. Now being maintained by Magenta Systems Ltd.
Rather than being a replacement for the Delphi service environment, DDService effectively updates the original SvcMgr.pas file with all the new features so it becomes DDSvcMgr.pas. To avoid distributing Embarcadero units, DDService has DIFF files for each different version which are used to patch your existing version and create DDSvcMgr.pas.This is done by CopyAndPatchSvcMgr.bat, see below.
If multiple versions of Delphi are installed, the latest version of SvcMgr.pas will be copied and patched, however the DDSvcMgr.pas unit created is backward compatible with all older versions of Delphi.
If upgrading to newer versions of Delphi after 10.3 Rio, a newer version
of DDCompilers.inc will be required, this file is a straight
If any previous version of DDService is already installed remove it from Components | Install Packages..
In RAD Studio or BDS installing the Delphi or C++ Builder packages
installs DDService into both Delphi and C++ Builder
1 - Unzip DDService.zip to a new or empty directory of your choice. Make
sure to unzip the directory structure included
2 - If not yet done run CopyAndPatchSvcMgr.bat in order to create unit
\Source\DDSvcMgr.pas which will copy the original
3 - Open group project file InstallDDServicexxxxx located in one of the sub directories of directory \Packages. Each IDE supported has its own sub directory, i.e if you want to install into Delphi or RAD Studio XE5 open \Packages\Delphi XE5\InstallDDServiceDelphiXE5.groupproj.
The IDE might ask for permission to create missing res-files, simply
confirm. In newer IDE versions additional project
4 - Build the (32-bit) runtime package (do not install).
6 - Build and then install the designtime package.
7 - Set search paths in Tools | Options:
Delphi XE2 and later
Delphi XE and older
C++ Builder XE5 and older
After installation a new item "DDService" is available in the repository
and on the Tool Palette containing wizards to create
- 06 March 07 Removed calls to Classes.(De)AllocateHwnd since they are not thread-safe. Made WndProc virtual.
- 08 Sept 07 New event OnRunException.
- 17 Oct, 08 New property ServiceName. Fixed a (CodeGear) bug in
TDDService.ReportStatus. As a result it is now possible to delay Vista
system shutdown in event OnPreshutdown. Also random ERangeErrors in function
ReportStatus are now gone.
- V1.4 03 Nov 08 ( version number introduced ;-) Value of property ImagePath is now enclosed in double quotes if it includes spaces in order to avoid error 193:0xc1 on service start, more details: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q812486. Added const WM_USER_DDSERVICE which should be used as a base to create custom message IDs for custom messages to be sent to the service window. New demos added.
- V1.5 13 Nov 08 load extended service API dynamically
- V1.6 Aug 09 Windows 7 service API headers and packages for Delphi 2010 added.
- V1.7 Aug 2010 packages for Delphi XE added.
- V1.8 Aug 2011 Added support for Delphi XE2 and C++ Builder 2006 - XE2.
- V1.8a Aug 2012 Added support for Delphi and C++ Builder XE3.
- V1.8b Apr 2013 Added support for Delphi and C++ Builder XE4.
- V1.8c Sep 2013 Added support for Delphi and C++ Builder XE5.
Updates by Magenta Systems Ltd
In this version messages WM_POWERBROADCAST as well as WM_DEVICECHANGE are trapped in the window procedure of the service window directly instead of registering/handling SERVICE_CONTROL_POWEREVENT and DEVICE_CONTROL_DEVICEEVENT. I think this is a solution since both control codes expect a message result/return which otherwise would require synchronize the control codes by SendMessage them from HandlerEx to the service thread window.
The DDService code is available from an SVN
Use username = ics and password = ics for read access.
Magenta Systems Ltd, 9 Vincent Road,
Croydon CR0 6ED, United Kingdom