Examples Delphi

These two function calls open and close the CD tray.
Because the command "wait" is included in the command string, the function returns after the command has been executed:

uses
MMSystem;

{ open the CD tray }
mciSendString('Set cdaudio door open wait', nil, 0, 0);
{ close the CD tray }
mciSendString('Set cdaudio door closed wait', nil, 0, 0);