I want to write a program to disconnect a specific USB device in Windows. Is there a function in windows API that can do this?
I have read the document about USB API but I still cann't find it.
Use SetupDiGetClassDevs and CM_Request_Device_Eject. For a complete example, see the reference Safely remove a USB drive using the Win32 API?