操作USB主要是用下面几个API,自己去找例子吧。API Function DLL Purpose ------------------------------------------------------------------ 1/HidD_GetHidGuid hid.dll Obtain the GUID for the HID class 2/SetupDiGetClassDevs setupapi.dll Return a device information set containing all of the devices a specified class.3/SetupDiEnumDeviceInterfaces setupapi.dll Return information about a device in the device information set.
4/SetupDiGetDeviceInterfaceDetail setupapi.dll Return a device pathname.
5/SetupDiDestroyDeviceInfoList setupapi.dll Free resources used by SetupDiGetClassDevs.
6/CreateFile kernel32.dll Open communications with a device.
7/HidD_GetAttributes hid.dll Return a Vendor ID, Product ID, and Version Number.
8/HidD_GetPreparsedData hid.dll Return a handle to a buffer with information about the device's capabilities.
9/HidP_GetCaps hid.dll Return a structure describing the device's capabilities.
10/HidD_FreePreparsedData hid.dll Free resources used by HidD_GetPreparsedData.
11/WriteFile kernel32.dll Send an Output report to the device.
12/ReadFile kernel32.dll Read an Input report from the device.
13/HidD_SetFeature hid.dll Send a Feature report to the device.
14/HidD_GetFeature hid.dll Read a Feature report from the device.
15/CloseHandle kernel32.dll Free resources used by CreateFile.
DLL
Purpose
------------------------------------------------------------------
1/HidD_GetHidGuid
hid.dll
Obtain the GUID for the HID class 2/SetupDiGetClassDevs
setupapi.dll
Return a device information set containing all of the devices a specified class.3/SetupDiEnumDeviceInterfaces
setupapi.dll
Return information about a device in the device information set.
4/SetupDiGetDeviceInterfaceDetail
setupapi.dll
Return a device pathname.
5/SetupDiDestroyDeviceInfoList
setupapi.dll
Free resources used by SetupDiGetClassDevs.
6/CreateFile
kernel32.dll
Open communications with a device.
7/HidD_GetAttributes
hid.dll
Return a Vendor ID, Product ID, and Version Number.
8/HidD_GetPreparsedData
hid.dll
Return a handle to a buffer with information about the device's capabilities.
9/HidP_GetCaps
hid.dll
Return a structure describing the device's capabilities.
10/HidD_FreePreparsedData
hid.dll
Free resources used by HidD_GetPreparsedData.
11/WriteFile
kernel32.dll
Send an Output report to the device.
12/ReadFile
kernel32.dll
Read an Input report from the device.
13/HidD_SetFeature
hid.dll
Send a Feature report to the device.
14/HidD_GetFeature
hid.dll
Read a Feature report from the device.
15/CloseHandle
kernel32.dll
Free resources used by CreateFile.
http://topic.csdn.net/t/20020121/13/489495.html