[TRUCO DELPHI] Encontrar el primer CD-DRIVE Disponible.
delphi
function FindFirstCDROMDrive: Char; Var DriveMap: DWORD; Mask : DWORD; i : Integer; Root : String; begin Result := #0; Root := 'A:\'; DriveMap := GetLogicalDrives; Mask := 1; For i := 1 To 32 Do begin If (Mask And DriveMap) <> 0 Then If GetDriveType(PChar(Root)) = DRIVE_CDROM Then begin Result := Root[1]; Break; end; Mask := Mask Shl 1; Inc(Root[1]); end; end;
Saludos!