Re: Safely removing hardware



Uwe Sieber wrote:
cartoper@xxxxxxxxx wrote:
I am working on a program that reads data from a removable device (USB Stick) that the user will insert into the computer and then when the data is removed, will need to remove the media. In the system tray, there is the icon/tool to "Safely Remove Hardware". How do I do that programmatically? I am working in C#, so if I can avoid dropping to the API level, that would be great, but with 10+ years of C/C++ experence, WinAPI level examples work, too!

Today I've seen that Vista
redetected an USB hard disk immediately after using
CM_Query_And_Remove_SubTree successfully.


With the flag CM_REMOVE_NO_RESTART the redetection does not happen.

Uwe
.