Format Floppy Disk

In this example you will learn how to open the windows format dialog,
and Disable your Program until the Format Dialog closed.
It will assure that the user will not use your program until the format process
is over, and will avoid errors.

The setting for  3.5" Floppy disk:
0 - format as 1.44 MB
5 - format as 720 KB

The setting for 5 1/4" Floppy disk:
0 - format as 1.2 MB
3 - format as 360 KB

Options :
0 - quick format
1 - Full format
2 - Copy system files only

You insert your setting like that:
RetVal = SHFormatDrive(Me.hwnd, Drive number, The setting for ? Floppy disk, Options)
replace the Drive number with the number of the drive you want to format,
for example: insert 0 for drive A:, 1 for drive B: and so on...
replace the The setting for ? Floppy disk with the number that specify your
desirable setting as mention above. for example: if you want to format floppy disk
inside a 3.5" floppy drive, and  you want to format it to 1.44 MB, insert the number 0.
replace the Options with the number that specify your desirable option as mention above
for example, if you want to do a quick format, insert the number 0.

In the following example, the dialog format will pop up and its default setting
will be: perform quick format on drive a: to 1.44 MB (if the drive is 3.5")

RetVal = SHFormatDrive(Me.hwnd, 1, 0, 0)

Go Back