Multimedia Delphi

Title: get notified: CD in/out
Question: need to know when the user inserts/extracts a CD?
Answer:
there's a message you can intercept to know this:
WM_DEVICECHANGE
so... the rest is easy
on the private section of your form, declare the function:
  Private
    { Private declarations }
    Procedure WMDeviceChange(Var Msg: TMessage); message WM_DEVICECHANGE;
the implement it:
Procedure TForm1.WMDeviceChange(Var Msg: TMessage);
Const
  CD_IN = $8000;
  CD_OUT = $8004;
Begin
  Inherited;
  Case Msg.wParam Of
    CD_IN : ShowMessage('CD in'); //or do whatever you want!!
    CD_OUT : ShowMessage('CD out')
  End
End;
that's it... you'll receive a message when you put a CD in/out... try it
then just instead of showing 'CD in'/'CD out'... do whatever you want
keep up coding!
- The source code of the article was formatted using my:
PAS 2 HTML converter
EberSys