Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Lock a cdrom, How?

Posted on 1997-07-25
3
Medium Priority
?
284 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 150 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and 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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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