DeviceManager.RegisterPersistentEvent method
Registers the specified Command to launch when the specified EventID for the specified DeviceID occurs. Command can be either a class identifier (CLSID) or the full path name and the appropriate command-line arguments needed to invoke the application.
Syntax
DeviceManager.RegisterPersistentEvent( _
ByVal Command As BSTR, _
ByVal Name As BSTR, _
ByVal Description As BSTR, _
ByVal Icon As BSTR, _
ByVal EventID As BSTR, _
[ ByVal DeviceID As BSTR ] _
) As HRESULT
Parameters
-
Command [in]
-
Type: BSTR
Required. String value.
-
Name [in]
-
Type: BSTR
Required. String value.
-
Description [in]
-
Type: BSTR
Required. String value.
-
Icon [in]
-
Type: BSTR
Required. String value.
-
EventID [in]
-
Type: BSTR
Required. String value.
-
DeviceID [in, optional]
-
Type: BSTR
String value.
Value Meaning - *
Default.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
For example code, see Implement a Windows Script Host Script that Runs Automatically in Shared Samples.
The RegisterPersistentEvent method requires Administrator permission to function successfully.
Requirements
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2003 R2 [desktop apps only] |
Header |
|
IDL |
|
See also
-
Reference