Characteristics of a Windows Service

To properly design and develop a Windows Service, it is important to understand how it differs from a typical Windows program. Here are the most important characteristics of a Windows Service:

  • It can start before a user logs on. The system maintains a list of Windows Services, which can be set to start at boot time. Services can also be installed such that they require a manual startup and will not start at bootup.
  • It can run under a different account from that of the current user. Most Windows Services provide functionality that needs to be running all the time, and some load before a user logs on, so they cannot depend on a user being logged on to run.
  • It has its own process. It does not run in the process of a program communicating with it.
  • It typically has no built-in user interface. This is because the service may be running under a different account from that of the current user, or the service may start at bootup, which means that calls to put up a user interface might fail because they are out of context.
  • Under certain operating systems, activities permitted in normal programs are not allowed in Windows Services. For example, you can play a sound from a Windows Service in Windows XP, but you cannot do so in Windows Vista, Windows Server 2008, or Windows 7.
  • User interaction with the service is accomplished either via a built-in Windows program, the Service Control Manager, or using a special external program you develop. Creation of such an external program is covered in this chapter. The Service Control Manager can be accessed through the Computer Management section of the Control Panel.
  • It requires a special installation procedure; just clicking on a compiled Windows service .exe file will not run it. The program must run in a special context in the operating system, and a specific installation process is required to do the configuration necessary for a Windows Service to be run in this special context.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset