template <class character>
bool get_service_display_name(handle manager,
                              const character* service_name,
                              character* display_name,
                              unsigned* buffer)

This function obtains the display name of a service.


handle manager

The handle of the service control manager.

const character* service_name

A pointer to the name of the service for which the display name is required.

character* display_name

A pointer to a buffer to hold the display name for the service.

unsigned* buffer

A pointer to a variable that holds the size (in characters) of the buffer pointed to by the previous parameter. Upon return from the function, the variable is set to contain the size (in characters) of the display name (excluding the null terminator). If the function fails because the buffer size is too small, the variable's value may be used to allocate a buffer of the required size.



true The function succeeded.
false The call failed.


The display name is the name that appears in the services control panel. It is also the name used by the NET START command. The service name is the name of the service as it appears in the registry.

To perform the converse mapping (that is, from display name to service name) the function get_service_key_name may be used.