The Windows operating system features built-in infrastructure services (Service Control Manager and Task Scheduler) that help manage background processes. Windows takes advantage of the built-in services to provide system management, device management, and
system maintenance functionality.
Significant improvements have been made to this infrastructure for Windows 7 and Windows Server 2008 R2. Developers can use these improvements to develop Windows services that are efficient and that contribute to the overall system performance and security.
Watch this demo to see an illustration of how to develop a service which starts on system triggered events.
Learn more at the MSDN Library. See the step-by-step guide with sample code.