views:

86

answers:

3

I wonder if there is an API to distinguish floppy and flash disk in windows, C++ And is it possible to link a flash disk to A:\? Many Thanks!

A: 

You can change the letters assigned to your drives somewhere in System Control, so the flash disk can be A:.

Use the OS API to query eg. the size of the disk, that should be enough to distinguish floppy and flash disk.

A: 

It is possible to link a flash disk to A:, but only if you have no floppy drives.
See Defining an MS-DOS Device Name for information about how to do this in a program.

You can determine whether a drive letter maps to a floppy device by using QueryDosDevice on the drive letter. Floppy drives will return "\Device\Floppy0" or "\Device\Floppy1"

John Knoeller
Note that the `\Device\Floppy<x>` names are not (always) used for USB floppy drives.
MSalters
@MSalters: well, that's unfortunate. Thanks for the info.
John Knoeller
See stephan's loink - it has the answer.
MSalters
+1  A: 
botismarius
Presumably for a USB floppy drive `pDevDesc->BusType == BusTypeUsb` too.
MSalters
Yes, but the question did not refer to usb floppy drives :D
botismarius