CD Tray notification
Hello folks, I have a question: Is it possible to make my application notified about CD-ROM events? Mostly I am interested at eject notification, I want my app to be able to respond somehow to this event. I have been searching for some MCI command or something, but found nothing useful. I think that it is possible to do, because i.e. Windows Explorer closes all folder windows which are on CD, when media is ejected. I just do not know where to start, is there some message to handle? Or maybe I sould mess around with CD-ROM driver?
Thanks for any help,
Hob
[573 byte] By [
Hobson] at [2007-11-20 5:00:04]

# 1 Re: CD Tray notification
The following gave me a lot of thoughts.
http://www.google.com/search?hl=en&q=detect+cd+eject&btnG=Google+Search
# 2 Re: CD Tray notification
hmm I think that 'detect' is the word I was missing when googling. Thanks, now I'd have to try to convert it somehow to C++. But not today, someday else.
Thanks,
Hob
Hobson at 2007-11-10 3:40:22 >

# 3 Re: CD Tray notification
You could try this:
MCI_STATUS_PARMS msp;
msp.dwItem = MCI_STATUS_MODE;
mciSendCommand(mciGetDeviceID("cdaudio"), MCI_STATUS_ITEM, MCI_WAIT, (DWORD)(LPVOID)&msp);
if(msp.dwReturn == MCI_MODE_OPEN) {
/* Do something */
}
:wave: