Hallo!
Ich habe mit der Funktion "_getdrive()" die Laufwerke meines Computers herausgefunden und in eine versteckte Listbox geschrieben.
Jetzt habe ich das Problem, daß ich unterscheiden muss, welches Laufwerk ein Floppy, ein CD-ROM, eine Festplatte oder Netzlaufwerk ist.
Kann mir da jemand weiterhelfen?
Danke im Vorraus.
-----------------------------------------------------------------------------------
Mein Quellcode:
char szDirectory[MAX_PATH];
CListBox *pListBox;
int drive, curdrive;
char szDrive[80];
// Save current drive in the Listbox (IDC_LISTDRIVES).
GetCurrentDirectory(sizeof(szDirectory),szDirectory);
pListBox = (CListBox*) GetDlgItem(IDC_LISTDRIVES);
pListBox->ResetContent();
curdrive = _getdrive();
// If we can switch to the drive, it exists.
for( drive = 2; drive <= 26; drive++ )
{
if( !_chdrive( drive ) )
{
sprintf(szDrive ,"%c:", drive + 'A' - 1 );
pListBox->AddString(szDrive);
}
}
_chdrive( curdrive );
SetCurrentDirectory(szDirectory);