Re: Unplug or eject hardware



nowhere@xxxxxxxxxxxxxx wrote:
Does anyone know how to invoke the "Unplug or eject hardware" function
of Windows programmatically rather than by the Tray Icon or the
Control Panel hardware wizard?
Specifically I want to unplug a USB device and wait until I get a
signal to say it's ok to remove the device.

I want this all to happen when the user exits the application, rather
than getting them to click the icon in the taskbar (if it's present)
and select Unplug or Eject Hardware, and then wait for the Ok message.



____
Chimaera
look at the DeviceIoControl in the Win32 help.
  that may help you.

.



Relevant Pages

  • Re: Unplug or eject hardware
    ... >> of Windows programmatically rather than by the Tray Icon or the ... >> Control Panel hardware wizard? ... >> and select Unplug or Eject Hardware, and then wait for the Ok message. ... DeviceIOControl(h, $2d4808, nil, 0, nil, ...
    (alt.comp.lang.borland-delphi)
  • Re: Unplug USB device
    ... where in the script is the USB device ... All I need is the code to unplug ... > You can accomplish this with a script: ... > sub SINK_OnObjectReady ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Unplug USB device
    ... mean disabling the USB device. ... All I need is the code to unplug ... >> set oContext = createObject ... >> WMI Test Engineer ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Unable to unplug the USB device if I open and close any document from USB device from my applic
    ... If you automatically change the working directory away from the device, ... application) then Windows Vista \ XP will not allow to unplug the USB ... To unplug the USB device I have to close my application. ...
    (microsoft.public.vc.mfc)
  • Re: Usb GPS installation problem
    ... But the problem starts when unplugging and and plugging again. ... > can I disable USB device detection when connecting the gps to usb port. ... system will find the right driver. ... stop the device before you unplug it. ...
    (sci.geo.satellite-nav)