Hello,

I am trying to capture a cd-rom eject request (both soft eject through software or physical button press.... i believe they are the same request) so that I can display a Message Box before the cd-rom tray is ejected alerting the user that an object blocking the cd-rom door may be in the way (dont ask).

Is there anyway to capture this event? I am trying to program some type of monitoring software in C.

Thanks!

Thanks for the reply.

I took a look at that before the post and unfortunately WM_DEVICECHANGE does not broadcast a message for CD-Rom eject, only the physical removal of the drive (such as USB) or media removal.

I need a way for windows to tell me when the cd-rom is ejected even if there is no CD/DVD in it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.