I am using WinUSB VB codes to display list of the devices that uses the same inf driver and then perform different task on each device.
The problem was if I connected and disconnected other USB devices (mouse, keyboard and etc), the OnDeviceChange() is executed.
I would like to have OnDeviceChange() executed if and only if any WinUSB device (same inf driver) is connected/ disconnected. Previously, I am thinking of to add in codes to count the number of WinUSB devices to do so. Please advise if there is better approach to implement this, thanks.
Protected Overrides Sub WndProc(ByRef m As Message)
Try
If m.Msg = DeviceManagement.WM_DEVICECHANGE Then
OnDeviceChange()
End If
MyBase.WndProc(m)
Catch ex As Exception
Throw
End Try
End Sub