servicemanager.RegisterServiceCtrlHandler

int/None = RegisterServiceCtrlHandler(serviceName, callback , extra_args )

Registers the Python service control handler function.

Parameters

serviceName : PyUnicode

The name of the service. This is provided in args[0] of the service class __init__ method.

callback : object

The Python function that performs as the control function. This will be called with an integer status argument.

extra_args=False : bool

Is this callback expecting the additional 2 args passed by HandlerEx?

Return Value

If the service manager is in debug mode, this returns None, indicating there is no service control manager handle, otherwise the handle to the Win32 service manager.