Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

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);

Hi,

du solltest dir mal die Funktion 'UINT GetDriveType(LPCTSTR lpRootPathName)' näher ansehen.

Das Ermitteln der Laufwerke kannst Du auch per API-Call erledigen:

Der entsprechende API-Call lautet GetLogicalDriveStrings und gibt Dir einen Zeiger auf eine Liste von null-terminierten Strings wieder, die jeweils einen Laufwerksbuchstaben enthalten.

Siehe auch hier:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/filesio_8jhv.asp

Den Laufwerktstyp kriegst Du mit Hilfe von GetDriveType (wie schon oben von Eight erwähnt).

HTH,

Evil

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.