Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "ControlService" in [All]

advapi32

.
Summary
The ControlService function sends a control code to a service.
.

public static extern bool    ControlService(IntPtr hService, SERVICE_CONTROL dwControl, ref SERVICE_STATUS lpServiceStatus);

.

Public Function ControlService(ByVal hService As IntPtr, ByVal dwControl As SERVICE_CONTROL, ByRef lpServiceStatus As SERVICE_STATUS) As Boolean

.

Declare Function ControlService Lib "advapi32.dll" (ByVal hService As Long, ByVal lControlCode As Long, ByVal lpServiceStatus As SERVICE_STATUS) As Boolean

.

bool res = Tools.ControlService(m_serv, SERVICE_CONTROL.STOP, ref stat);

.

     private void DoControlService (SERVICE_CONTROL aServiceControl)

.

         if (!Interop.ControlService(serviceHandle, aServiceControl, ref serviceStatus))

.

     internal static extern bool ControlService (

.
Documentation
[ControlService] on MSDN
.

    ///     Required to call the ControlService function to stop the service.

.

    /// Required to call the ControlService function to pause or continue

.

    /// Required to call the ControlService function to specify a user-defined

.

    '''     Required to call the ControlService function to stop the service.

.

    ''' Required to call the ControlService function to pause or continue

.

    ''' Required to call the ControlService function to specify a user-defined

Structures

.
Summary
The SERVICE_STATUS structure contains information about a service. The ControlService, EnumDependentServices, EnumServicesStatus, and QueryServiceStatus functions use this structure to return information about a service. A service uses this structure in the SetServiceStatus function to report its current status to the service control manager.
.

See ControlService for SERVICE_STATE definition.


 
Access PInvoke.net directly from VS: