safely remove USB stick

Stijn

New member
Joined
Feb 24, 2004
Messages
4
Location
Belgium
I wrote an application where the user needs an USB memory stick. When the user closes the program, some data is written to the stick.

Can I write some code so my application is closing the usb stick whithout an action of the user?

When I do not implement this, the user have to click on an icon in the taskbar for removing the usb stick safely. But i want to keep it simpel for the user ;)

Does anyone knows some solution?
 
I believe passing the control code FSCTL_DISMOUNT_VOLUME to the Win32 API [api]DeviceIOControl[/api] will dismount the USB memory stick. Getting a IO handle to the disk is as simple as calling [api]CreateFile[/api].
 
Back
Top