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 "SetServiceStatus" in [All]

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.
.

Estimated time required for a pending start, stop, pause, or continue operation, in milliseconds. Before the specified amount of time has elapsed, the service should make its next call to the SetServiceStatus function with either an incremented dwCheckPoint value or a change in dwCurrentState. If the amount of time specified by dwWaitHint passes, and dwCheckPoint has not been incremented or dwCurrentState has not changed, the service control manager or service control program can assume that an error has occurred and the service should be stopped. However, if the service shares a process with other services, the service control manager cannot terminate the service application because it would have to terminate the other services sharing the process as well.

.

Utility class to manage SetServiceStatus()

.

    internal static extern bool SetServiceStatus(IntPtr handle, ref ServiceStatus serviceStatus);

.

        SetServiceStatus(handle, ref myServiceStatus)

.

        SetServiceStatus(handle, ref myServiceStatus);

.

For more on writing services in .NET please search Google on: 'SetServiceStatus' and 'ServiceBase'

.

   private static extern bool SetServiceStatus(IntPtr hServiceStatus, ref SERVICE_STATUS lpServiceStatus);

.

Declare Function SetServiceStatus Lib "advapi32.dll" (

.
Documentation
[SetServiceStatus] on MSDN

advapi32

.

         Interop.SetServiceStatus (statusHandle, ref serviceStatus);

.

                 Interop.SetServiceStatus (statusHandle, ref serviceStatus);

.

     internal static extern bool SetServiceStatus (IntPtr hServiceStatus, ref SERVICE_STATUS lpServiceStatus);

user32

.

        SetServiceStatus(handle, ref myServiceStatus);


 
Access PInvoke.net directly from VS: