Platforms to show: All Mac Windows Linux Cross-Platform
/USB/HID Windows/USB HID Devices Win
Required plugins for this example: MBS USB Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /USB/HID Windows/USB HID Devices Win
This example is the version from Sun, 17th Mar 2012.
Project "USB HID Devices Win.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
EventHandler Sub DoubleClick()
MsgBox ListBox1.cell(ListBox1.ListIndex,6)
End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
EventHandler Sub Open()
dim m as new WinHIDMBS
dim i as integer
#if not TargetWin32
MsgBox "This example requires Windows."
#endif
if m.FindFirstDevice then
do
ListBox1.AddRow ""
ListBox1.Cell(ListBox1.LastIndex,0)=hex(m.ProductID)
ListBox1.Cell(ListBox1.LastIndex,1)=hex(m.VendorID)
ListBox1.cell(ListBox1.LastIndex,2)=fix(m.Product)
ListBox1.cell(ListBox1.LastIndex,3)=fix(m.Manufacturer)
ListBox1.cell(ListBox1.LastIndex,4)=fix(m.SerialNumber)
ListBox1.cell(ListBox1.LastIndex,5)=hex(m.VersionNumber)
ListBox1.cell(ListBox1.LastIndex,6)=m.DevicePath
loop until not m.FindNextDevice
end if
Title=str(ListBox1.ListCount)+" devices found."
End EventHandler
Protected Function fix(s as string) As string
if len(s)=1 and asc(s)=1033 then
Return ""
else
Return s
end if
End Function
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project
See also:
The items on this page are in the following plugins: MBS USB Plugin.