• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1957
  • Last Modified:

Eject a USB device

I would Like to eject a USB device from C#, I have the Drive Letter and have found a function in Kernel32.dll (CM_Request_Device_Eject) that can , if provided with an InstanceHandle, request that the USB device is removed.

I have found the UsbEject sample on Code Project on the net but that is dependent on loading the entire device tree into memory and then retrieving that way, I am looking for a/some functions that given a drive letter will return me a InstanceHandle.

If anyone has solutions that differ to the above I would also be interested
0
S31B1
Asked:
S31B1
  • 4
1 Solution
 
ColemssCommented:

Make the last column not sizeable and Force it to always stretch to the end of the grid.
0
 
ColemssCommented:
Sorry about that wrong post,  But im looking for your answer right now :-)
0
 
ColemssCommented:
This is another code project sample.
http://www.codeproject.com/KB/system/DriveDetector.aspx

More to come
0
 
ColemssCommented:
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now