Char CR [3];
CHAR LABLE [12];
For (int N = 0; n <= 25; n )
{
CString Str;
Str.Format ("% C:", N 'A');
STRCPY (Cr, STR);
INT DT = GetDriveType (CR);
INT succeed = getVolumeInformation (Cr, Lable, 12, NULL, NULL, NULL, NULL, 0);
Switch (DT)
{
Case Drive_Unknown:
{
Str.Format ("(% s)% s is driving_unknown!", Lable, CR);
Break;
}
Case Drive_removable:
{
IF (success)
{
Str.Format ("(% s)% s it drive_removable!", lable, cr);
}
Else
{
Str.Format ("% s is drive_removable!", cr);
}
Break;
}
Case drive_fixed:
{
Str.Format ("(% s)% s is driving_fixed!", Lable, CR);
Break;
}
Case Drive_Remote:
{
Str.Format ("(% s)% s is drive_remote!", Lable, CR;
Break;
}
Case drive_cdrom:
{
Str.Format ("(% s)% s is drive_cdrom!", lable, cr);
Break;
}
Case Drive_ramdisk:
{
Str.Format ("(% s)% s is driving_ramdisk!", lable, cr);
Break;
}
DEFAULT:
{
Str.empty ();
Break;
}
}
IF (! str.isempty ())
{
AfxMessageBox (STR);
}
}