You could use mciGetCreatorTask, but I don't know how, or you could do this:

Code:
Do
   chDir E:\ (or whatever you're CD-ROM drive is)
Loop until err.number <> 0

'code to excecute when it's open
I know it's a little far-fetched, but it may work. (Q #4)