he RegisterServiceCtrlHandler function registers a function to handle service control requests for a service. SERVICE_STATUS_HANDLE RegisterServiceCtrlHandler(    LPCTSTR lpServiceName, // address of name of service 
    LPHANDLER_FUNCTION lpHandlerProc  // address of handler function 
   );
 ParameterslpServiceNamePoints to a null-terminated string that names the service run by the calling thread. This is the service name that was specified in the CreateService function when the service was created. lpHandlerProcPoints to the Handler function to be registered.  Return ValuesIf the function succeeds, the return value is a service status handle.
If the function fails, the return value is zero. To get extended error information, call GetLastError