//Denna kod stänger cd-romen
function CdClose(const Value: char): integer;
var
strCommand: string ;
strError: array[0..MAX_PATH] of char;
begin
strCommand := 'open ' + Value + ': type cdaudio alias xxx';
MCISendString(PChar(strCommand), nil, 0, 0);
strCommand := 'set xxx door closed';
Result := MCISendString(PChar(strCommand), nil, 0, 0);
strCommand := 'close xxx';
MCISendString(PChar(strCommand), nil, 0, 0);
if Result <> 0 then
MCIGetErrorString(Result, strError, 255);
MessageDlg(strError, mtError, [mbOK], 0);
end;
//Denna kod öppnar cd-romen
function CdOpen(const Value: char): integer;
var
strCommand: string ;
strError: array[0..MAX_PATH] of char;
begin
strCommand := 'open ' + Value + ': type cdaudio alias xxx';
MCISendString(PChar(strCommand), nil, 0, 0);
strCommand := 'set xxx door open';
Result := MCISendString(PChar(strCommand), nil, 0, 0);
strCommand := 'close xxx';
MCISendString(PChar(strCommand), nil, 0, 0);
if Result <> 0 then
MCIGetErrorString(Result, strError, 255);
MessageDlg(strError, mtError, [mbOK], 0);
end;