Solved

Lock a cdrom, How?

Posted on 1997-07-25
3
276 Views
Last Modified: 2013-12-03
I use VC++4.2 on Win95, how can I lock the cdrom so the user
can't open the tray by pressing the eject button on the cdrom panel? I know it can be done by software but don't know how. Is there an API call for this or I need to go low level(programming interrupt thing)?
Any help is appreciated
0
Comment
Question by:danli020797
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
overworked earned 50 total points
ID: 1401980
I can't remember if the command is available through Windows API but if it isn't there, there is a good reason. First of all, it will serve no purpose to you since locking the tray does not defeat the hardware cd eject button. The hardware cd eject button will unlock the tray before opening. However, locking the tray will defeat software attempts to eject until the tray is unlocked first. The tray lock/unlock functions are available via MSCDEX function calls as far as I know.
0
 

Author Comment

by:danli020797
ID: 1401981
The reason I want to lock the cdrom is that I am writing an app. to play video from cdrom. I can't open the tray after I open the device, otherwise I will get the Blue Screen even though the cd is not playing. So I need the user to eject from my app so I can close the device first. I saw another app did exact the same thing.
Could you tell me how MSCDEX works, through switches?
Thanks
0
 

Expert Comment

by:overworked
ID: 1401982
There's an MSCDEX techref kit floating around that's distributed by Microsoft. Try searching the net and MS web site. However, I would recommend polling MCI cdrom (MCI_STATUS) every half second to see if cdrom was ejected by user and handle that way. The best way to do this is to get MCI_STATUS in your WM_TIMER and save it, compare it with the last saved, and if different see what the condition is (see if media ejected).
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question