CServiceModule::Handler is the routine that the SCM calls to retrieve the status of the service and give it various instructions (such as stopping or pausing). The SCM passes an operation code to Handler to indicate what the service should do. A default ATL-generated service only handles the stop instruction. If the SCM passes the stop instruction, the service tells the SCM that the program is about to stop. The service then calls PostThreadMessage to post a quit message to itself. This terminates the message loop and the service will ultimately close.
To handle more instructions, you need to change the dwControlsAccepted data member initialized in the CServiceModule::Init function. This data member tells the SCM which buttons to enable when the service is selected in the Services Control Panel application.