Unplug or Eject Hardware APIs
-
Hi All, Anyone knows how to safely "Unplug or Eject Hardware" without having to click that green arrow icon on the system tray? I want to write an application using some window API to do it. Normally that icon appear when i plug in my USB storage. I have searched the web, some people use DeviceIOControl to eject, but it doesn't really remove the device as when i click the icon and "Stop USB Storage Device - Drive G:" Can anyone enlighten me please? I refuse to believe that i cannot do this using some window APIs... Thanks!!
-
Hi All, Anyone knows how to safely "Unplug or Eject Hardware" without having to click that green arrow icon on the system tray? I want to write an application using some window API to do it. Normally that icon appear when i plug in my USB storage. I have searched the web, some people use DeviceIOControl to eject, but it doesn't really remove the device as when i click the icon and "Stop USB Storage Device - Drive G:" Can anyone enlighten me please? I refuse to believe that i cannot do this using some window APIs... Thanks!!
You will need the DDK to get the docs, headers, and libs. The relevant functions are
CM_Locate_DevNode()
,CM_Query_And_Remove_SubTree()
, andCM_Request_Device_Eject()
--Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Pinky, are you pondering what I'm pondering? I think so Brain, but how will we fit the hamster inside the accordion?