Partager via


Activating a Service Programmatically

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Services.exe can load a service based on the value located in the built-in registry key located under the HKEY_LOCAL_MACHINE\Services\<Service Name> registry key.

To load a service programmatically, you must call the ActivateService function. The following code example shows how to load the Telnet server using ActivateService.

ActivateService(L"TELNETD", 0);

A call to ActivateService will cause Services.exe to load the Telnet server based on the settings located under the HKEY_LOCAL_MACHINE\Services\TELNETD registry key. Upon completion of loading the service, ActivateService will load any super service sockets that are appropriate.

See Also

Reference

RegisterService
ActivateService

Concepts

Registering a Service Programmatically

Other Resources

Services.exe