Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unplug or Eject Hardware APIs

Unplug or Eject Hardware APIs

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarejsontutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IceBerG71
    wrote on last edited by
    #1

    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!!

    M 1 Reply Last reply
    0
    • I IceBerG71

      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!!

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      You will need the DDK to get the docs, headers, and libs. The relevant functions are CM_Locate_DevNode(), CM_Query_And_Remove_SubTree(), and CM_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?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups