STOP/UNPLUG usb hardware


When you plug in a USB device, you get an icon in the tray which lets you stop a usb device to unplug it.

I'd like to do this from delphi.

Can anybody help?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

robert_marquardtConnect With a Mentor Commented:
The central function is CM_Request_Device_Eject from the Config Manager API.
contact me directly and i can send you the header conversion for the file.

robert_marquardt att gmx dott de
Wim ten BrinkSelf-employed developerCommented:
Robert, please avoid direct contact with people who ask questions because this often results in PAQ'ed Questions in EE without any answer. EE is not just meant to answer questions but also to become an knowledge database for the whole community. Thus questions without answers would not be useful here.
Either post a link to the converted header file or copy&paste the whole header here...
I have not made the headers public yet and it has a size of 144K. No other way as direct contact for experiments.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Wim ten BrinkSelf-employed developerCommented:
Well, if you didn't make them public yet then it might be better that you don't share them with someone else. In which case you might have a solution but not one that is useful for EE. So, my advise: HURRY! Make it public ASAP because if you're already giving copies away it soon will be public anyway... :-)
Or just post a simple code example, if possible...
jamesr123456Author Commented:

How do I use CM_Request_Device_Eject? by the way the device does not have a drive letter

I have two examples. One tries to mimic the display of the Device Manager, the other simply tests some of the enumerations available in the Config Manager API.
The trick to match a drive letter to a device to call CM_Request_Device_Eject on i do not know yet.

The dialog of the "safe removal" tray application can be shown programatically. The corresponding HOTPLUG.DLLis also a standard Control Panel DLL which can be accessed like any other Control Panel.
That DLL is probably also a way to handle the "safe removal"
programatically. At least the exported names indicate that.
Can I have the header conversion for the file? I can offer 500 points for it.
No real need for points.
Contact me directly robert_marquardt att gmx dott de
And a free "safe removal" experiment too :-)
Fail when try to send you a mail. Maybe you can do this at test att construiesc dottt ro. Thanks!
Thanks Robert!
I try to run the project but can't find ModuleLoader. I lost something ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.