Creating a Windows Service in Delphi
(Page 1 of 5 )
Service applications let you check for updates on a system or monitor system resources, without interrupting your work. While they can be difficult to create, Delphi makes it simple. This article explains how to create a simple Windows service application in Delphi, which you can build on and modify to suit your own needs.
Introduction
A service is an application type that runs in the background, and is similar to UNIX daemon applications. It is an ideal way to check for updates on a remote system or to monitor system resources, without interrupting whatever you’re doing in the front end. If you open up Task Manager by pressing Ctrl + Alt + Del, you will see a list of Services currently running on your system. Here’s a sample:

Why would you need a service application? Well, if you have a networked system that is on 24/7, and you want to monitor the amount of resources used by a certain application, then a service is the best way to do it. Similarly, if you write software that requires updates from time to time, you can create a service that will look for those updates and download them. So, service applications have a lot of advantages. The only problem with Services is that they are not very flexible in that you cannot use any visual components in the application. You'll get an exception "Controls Cannot Be Added to a Service" message if you try to drop a visual component.
Is it difficult to create a service? Yes, mostly because it is a special type of application. Fortunately for us, Delphi makes it very easy to build one.
Next: Let’s Create a Service >>
More Delphi-Kylix Articles
More By Jacques Noah