Home
Recent changes

ATL code
WTL code
MFC code
C++ code
.Net code
PocketPC code
Miscellaneous

viksoe.dk

CServices class

A small MFC class that wraps the Windows NT Service API functions.

The class lets you control a service, just like the Services control-panel applet. This includes starting and stopping a service.

Interface

 NameDescription
CreateCreates a new service.
DeleteDeletes a service.
StartStarts a service.
StopStops the service.
IsRunningIs the service running?
IsInstalledIs the service installed?
GetStateReturns the state of the service.
GetStateStringReturns the state text.
GetDisplayNameReturns the service's display name.
GetServiceNameReturns the internal name.
SendMessageSends a message to the service.
GetLastErrorReturns the last error code.

Source Code Dependencies

Microsoft MFC Library
My Global MFC functions

Download Files

DownloadSource Code (5 Kb)


Written by Bjarke Viksoe.
Article submitted 6/7/2001.