A service can be stopped through the ControlService() API by sending a SERVICE_CONTROL_STOP request to the service through the SCM.
you can read the following in MSDN
HOWTO: Programmatically Stop a Service and Its Dependencies Q245230
you can read the following in MSDN
HOWTO: Programmatically Stop a Service and Its Dependencies Q245230
net start w3svc
net start msftpsvc
net start smtpsvc