Autor Beitrag
G-man
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 258

Win 2000, Win ME, SuSE 8.2
D5 Standard, D6 Professional
BeitragVerfasst: Mi 04.06.03 11:52 
Hallo,

ich will alle CD/DVD-Laufwerke herausbekommen , und das Ergebnis dann in eine ComboBox stecken (Laufwerkname + belegt /nicht belegt). Wie geht das?

G-man

_________________
...To err is human, but to really foul things up requires a computer.
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Do 05.06.03 16:45 
Ist ganz einfach: gehe alle Laufwerke (A-Z) durch:
- Mit GetDriveType stellst du fest, um was für ein Laufwerk es sich handelt, z.B. CD, HDD
- Mit DiskSize ermittelst du, ob sich ein MEdium im Laufwerk befindet (-1 = kein Medium)

Leider weiß ich nicht, wie man zwischen Cd, DVD und CD-R/W unterscheidet.

_________________
Life is a bad adventure, but the graphic is really good!
DaFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 189



BeitragVerfasst: Do 05.06.03 17:51 
Hallo!

In der Tat liefert GetDriveType für alle CD- und DVD-Laufwerke DRIVE_CDROM zurück. Eine Unterscheidung ist dadurch nicht möglich.
Eine einfache Lösung liegt auf der Hand: Man sucht im Gerätenamen nach dem String "DVD", das muss aber nicht immer funktionieren (den Namen bestimmt ja der Hersteller). Eine bessere Variante wäre durch SCSI/ASPI-Programmierung die Laufwerkseigenschaften auszulesen. Ist die DVD property enabled, so handelt es sich um ein DVD-Laufwerk. Dies habe ich allerdings noch nie gemacht, kann also dazu leider keine Hilfestellungen geben.

Gruß,
Markus
G-man Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 258

Win 2000, Win ME, SuSE 8.2
D5 Standard, D6 Professional
BeitragVerfasst: Fr 06.06.03 12:00 
Jo fein,
ich bin jetzt schon ein Stück weiter gekommen,
aber trotzdem wäre eine bisschen Code nicht schlecht...

_________________
...To err is human, but to really foul things up requires a computer.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Di 10.06.03 10:45 
Hallo!

G-man hat folgendes geschrieben:
aber trotzdem wäre eine bisschen Code nicht schlecht...

Dann such mal hier im Forum nach GetDriveType.

Gruß
Tino
G-man Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 258

Win 2000, Win ME, SuSE 8.2
D5 Standard, D6 Professional
BeitragVerfasst: Fr 27.06.03 14:15 
Jo, so einen Code habe ich gefunden...
Aber ich will nur die Laufwerksbuchstaben (e:\, f:\ etc.) herausbekommen
und in eine ComboBox stecken.

_________________
...To err is human, but to really foul things up requires a computer.