La Web del Programador: Comunidad de Programadores
 
    Pregunta:  19305 - NO. DE SERIE
Autor:  luis enrique mendoza
Como puedo hacer para obtener el no. de serie (de fabricación) de un cd. ??

  Respuesta:  Luis Felipe García Gutiérrez
una forma mas sencilla sería...

var
w,Numero:DWord;
begin
GetVolumeInformation(PChar('C:\'),Nil,0,@Numero,w,w,Nil,0);
end;

y en "Numero" queda almacenado en número de serie de la unidad, y así como aquí se hizo con el disco C, éste se puede cambiar por la que necesites.

Suerte!!!

  Respuesta:  jorge luis guzman abreu
con este procedimiento.

procedure TForm1.Button1Click(Sender: TObject);

function AudioCDNum(Unidad: char):string;
var
mp : TMediaPlayer;
MInfo : TMCI_INFO_PARMS;
SerialN : array[0..255] of char;

begin
Result:='';
mp := TMediaPlayer.Create(nil);

try
with mp do
begin
Visible := false;
Parent := Application.MainForm;
Shareable := true;
DeviceType := dtCDAudio;
FileName := Unidad+':';
Open;
end;
Application.ProcessMessages;

FillChar(SerialN, sizeof(SerialN), #0);
FillChar(MInfo, sizeof(MInfo), #0);
MInfo.lpstrReturn := @SerialN;
MInfo.dwRetSize := 255;
if mciSendCommand(Mp.DeviceId,
MCI_INFO,
MCI_INFO_MEDIA_IDENTITY,
longint(@MInfo)) <> 0
then Raise Exception.Create('Error');
mp.Close;

Result:=String(SerialN);
finally
Application.ProcessMessages;
mp.free;
end;
end;

begin
Label1.Caption:=AudioCDNum('F');
end;