ServiceController::ServiceHandle Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the handle for the service.

Namespace:   System.ServiceProcess
Assembly:  System.ServiceProcess (in System.ServiceProcess.dll)

public:
[BrowsableAttribute(false)]
property SafeHandle^ ServiceHandle {
	SafeHandle^ get();
}

Property Value

Type: System.Runtime.InteropServices::SafeHandle^

A SafeHandle that contains the handle for the service.

Exception Condition
InvalidOperationException

The service was not found.

SecurityPermission

for access to unmanaged code. Associated enumeration: SecurityPermissionFlag::UnmanagedCode.

.NET Framework
Available since 2.0
Return to top
Show: