Creating a Windows service

Some kind of application needs to be running H24. Usually, these are network servers or data transfer / monitoring applications. In these cases, you probably start with a normal GUI or console application; however, when the systems are to be used in production, you face a lot of problems related to the Windows session termination, reboots, user rights, and other issues related to the server environment.

Getting ready

The way to go, in the previous scenario, is to develop a Windows service. In this recipe, we'll see how to write a good Windows service scaffold and this can be the skeleton for many other services, so feel free to use this code as a template to create all services that you will need.

How to do it…

The project ...

Get Delphi Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.