Try responding to the
WM_DEVICECHANGE[
^] window message. A WParam value of
DBT_DEVICEARRIVAL[
^] should indicate a new cd/usb drive.
Will probably only work if you have auto insert notification turned on for the drive.
[Edit: Oops, should have hit refresh before posting. I agree with Luc]