USB Monitoring Control - TODO
Download USB Monitoring Control Hide this button

IUsbMonitor Interface

This is the first interface you get from the USBMC library. It is used to get the list of installed USB devices and create Monitor objects. You get a reference to this interface when you create the UsbMonitor object. It is a central entry point to the monitoring library.

CComPtr<IUsbMonitor>	pUM;
HRESULT hr = pUM.CoCreateInstance(__uuidof(UsbMonitor));
if (FAILED(hr))
{
    MessageBox(L"Error opening the USBMC control", L"Error", MB_ICONSTOP | MB_OK);
    return TRUE;
}
// use pUM here
hhdusbmcLib.UsbMonitor mc = new hhdusbmcLib.UsbMonitor();
// use mc here

Declaration

interface IUsbMonitor extends ${IDispatch} {
    // Properties
    readonly ${Devices}: ${IDeviceCollection};

    // Methods
    ${CreateMonitor}(): ${IMonitoring};
    ${InstallLicense}(LicenseFile: string): void;
}
public interface IUsbMonitor : ${IDispatch}
{
    // Properties
    ${IDeviceCollection} ${Devices} { get; }

    // Methods
    ${IMonitoring} ${CreateMonitor}();
    void ${InstallLicense}(string LicenseFile);
    void ${InstallLicenseInMemory}(byte[] data);
    void ${DisplayActivationDialog}(IntPtr hWnd);
}
struct IUsbMonitor : IDispatch
{
    // Properties
    ${IDeviceCollectionPtr#IDeviceCollection} ${Devices};  // get 

    // Methods
    ${IMonitoringPtr#IMonitoring} ${CreateMonitor}();
    HRESULT ${InstallLicense}(_bstr_t LicenseFile);
    HRESULT ${InstallLicenseInMemoryNative}(UCHAR * pData, ULONG size);
    HRESULT ${DisplayActivationDialog}(HWND hWnd);
};

IUsbMonitor Properties

Devices

readonly Devices: ${IDeviceCollection};
${IDeviceCollection} Devices { get; }
${IDeviceCollectionPtr#IDeviceCollection} Devices;  // get 

Reference to the device collection object.

IUsbMonitor Methods

CreateMonitor

CreateMonitor(): ${IMonitoring};
${IMonitoring} CreateMonitor();
${IMonitoringPtr#IMonitoring} CreateMonitor();

Creates a new monitor object that is ready to be attached to USB device.

InstallLicense

InstallLicense(LicenseFile: string): void;
void InstallLicense(string LicenseFile);
HRESULT InstallLicense(_bstr_t LicenseFile);
LicenseFile
The full path to the license file.

Install a license stored in a given file.

InstallLicenseInMemory

// This method is not available in scripting environment
void InstallLicenseInMemory(byte[] data);
// This method is not available in native environment
data
Byte array that stores the contents of the license file.

Install a license stored in a memory buffer.

InstallLicenseInMemoryNative

// This method is not available in scripting environment
// This method is not available in managed environment
HRESULT InstallLicenseInMemoryNative(UCHAR * pData, ULONG size);
pData
Pointer to a memory buffer that holds the contents of the license file.
size
Size of the buffer pointed by pData, in bytes.

Install a license stored in a memory buffer.

DisplayActivationDialog

// This method is not available in scripting environment
void DisplayActivationDialog(IntPtr hWnd);
HRESULT DisplayActivationDialog(HWND hWnd);
hWnd
Dialog's parent window handle. May be 0.

Display the activation dialog.