Remember to include Windows in your uses clause :<br><br>function GetVolumeID(DriveChar: Char): String;<br>//Para obtener el # de serie de un disco<br>var<br> MaxFileNameLength, VolFlags, SerNum: DWord;<br> DrivePath : String;<br>
begin<br> DrivePath := DriveChar + ':\';<br> if GetVolumeInformation(PChar(DrivePath), nil, 0,<br> @SerNum, MaxFileNameLength, VolFlags, nil, 0)<br> then<br> begin<br> Result := IntToStr(SerNum);<br>
end<br> else<br> Result := '';<br>end; <br>