DD Service Application Framework
Download Latest DDService
8th November 2023 - DDService for Delphi 12.
24th May 2022 - DDService for Delphi 11.1
17th September 2021 - DDService for Delphi 11.0
1st June 2021 - DDService for Delphi 10.4.2 Sydney, they changed Vcl.SvcMgr.pas which stopped our patch working
7th July 2020 - DDService for Delphi 10.4 Sydney
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, 10.3 Rio, 10.4 Sydney and 11.0, 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 11.0, a newer version of DDCompilers.inc will be required, this file is a straight copy of OverbyteIcsDefs.inc from the ICS package which is updated regularly.
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 to XE8, D10.0 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
- 7 July 2020 Added support for Delphi 10.4 Sydney.
- 1 June 2021 Vcl.SvcMgr.pas has changed with Delphi 10.4.2 by removing deprecated thread suspend/resume, so created a new version of the DIFF file, note no longer works with 10.4.0 or 10.4.1.
- 17 Sept 2021 Added support for Delphi 11.0.
- 24th May 2022 Added support for Delphi 11.1 which adds an extra line to Vcl.SvcMgr.pas, no longer supporting RTM. CreateSetEnvBat now correctly installs the path for D11, thanks to Drin Greaham for finding this.
- 5th November 2023 Added support for Delphi 12. Windows 11 no longer opens BAT files by default, so now using SetEnv.cmd and CopyAndPatchSvcMgr.cmd.
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