ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / USB functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
USBListDevice (Function)
In french: USBListePériphérique
Returns the list of USB devices currently plugged into the current computer.
Example
// List of USB devices
sList is string = USBListDevice()
// Start to explore without specifying an identifier
Explore("")
// -----------------------------------------------------------
// Explore the entire tree structure
PROCEDURE Explore(sBeginning)
sList is string
sList = USBListDevice(sBeginning)
IF sList <> "" THEN
sDevice is string
FOR EACH STRING sDevice OF sList SEPARATED BY CR
   Trace(USBProperty(sDevice, USBPropertyDeviceDesc))
   Explore(sDevice)
END
END
Syntax
<Result> = USBListDevice([<Device Identifier> [, <Options>]])
<Result>: Character string
  • List of identifiers for the USB devices currently plugged into the current computer. This list has the following format:
    <Identifier 1> + CR + <Identifier 2> + CR + ...

    If the <Options> parameter corresponds to the USBLstDescription constant, the list of identifiers has the following format:
    <Identifier 1> + TAB + <Description 1> + CR + <Identifier 2> + CR + ...

    The identifier is used to identify a USB device. This identifier will be used by the USB functions to handle a device.
  • Empty string ("") if no USB device is found.
<Device Identifier>: Optional character string
Identifier of USB device from which the search will be performed (see the notes)
<Options>: Optional Integer constant
Detailed option of result:
USBLstDescriptionUsed to get the list of identifiers for the USB devices and their description.
Remarks
The USB devices are organized in tree structure.
The roots are the USB controllers. The hubs and the devices are located below. Each device can be "parent" of a "sub-tree".
For example, a USB hub can access the devices plugged into it.
USBListDevice can be called without identifier. In this case, the function returns the identifiers of the USB controllers. If USBListDevice is called again with these identifiers, you will be able to retrieve the list of devices connected to it. This tree structure can be browsed until the function returns "" (empty string).
Component: wd290std.dll
See also
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help