Solved

Override eject?

Posted on 1998-02-17
12
327 Views
Last Modified: 2010-04-04
Is it possible to override the eject (hardware and software) on a CD-ROM?  We are writing a piece of software which cannot have the CD ejected once the software is running.

If the answer is yes, can you please post some code as an example.

Thanks,

Stuart.
0
Comment
Question by:Stuart_Johnson
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359482
Hi Stuart,

Not long ago I solved a question, for detecting when a new cd is inserted or a cd is ejected. Maybe this can be a solution for you too. When the user pushes an eject button, you can cancel it. I made a component of it. You can find it on Torry's or Delphi Supe r Page. Look for TCDEVENTS. Offcourse I can also e-mail it to you.

http://sunsite.icm.edu.pl/delphi/
http://torry.rimini.com/

I'll look this weekend if I can find something to about disabling this event.

Please, send me some comments about the component.

Regards,
Zif.

0
 
LVL 3

Expert Comment

by:Matvey
ID: 1359483
Hi Stuart! Hi Zif!

I think there is an MCI (maybe API general) command for locking. -I'll search...

Bye for now!
-Matvey
0
 
LVL 4

Expert Comment

by:d003303
ID: 1359484
the ASPI interface provides a mechanism for locking removable devices. But ASPI is only SCSI...no ATAPI
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359485
Hi Stuart!

Looked at my component?
Well, it is possible to reject the ejects, but it must be capable with your CD-rom player. Every player I've seen at the moment, don't send that specific message.
What you can do for the moment, is using my component! It's freeware, so that can't be harmfull I supose. If an eject button is pressed, just say that the user needs to reenter the CD.

Regards,
ZiF.
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1359486
ZifNab,

I had a quick look the other day for your component and couldnt find it.  Any chance of emailing it too me (stuartj@gos.dragon.net.au).  

d330030: Unfortunately I cant just target one type of interface.

Matvey: I've searched the MCI command list and cant find anything in there.  If you do, please let me know!

Thanks guys,

Stuart
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359487
Ok Stuart I'll send it to you. Hope it's usefull for you. Soon a new version will be on the net. It's freeware, but ...
I really would like to get an email, for what you use it, what you think about it, improvements ....
PS. The new version has disable/enable autorun (easy to do) and I also implement the events which are fires before an eject (so you can cancel, them). But as I already said, I haven't found a CD-player that really fires this event.
Matvey, Stuart if you want to be notified for a new version, just send me a nice email!.

c.u. Zif.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:Matvey
ID: 1359488
Hi there!

:-( Bad news:
I searched for a lock command in MCI but I didn't find it.
It looks like there is no "DeviceQueryRemove" message for CDROMs also, so you can't cancel it in the usual way.

I hope that Zif's idea works here. Zif, did you try it? what do you do exactly for getting it locked?

If it works then I guess you can make a "locked" property for your component or something...:-)

Well, good luck to you both!
Bye!
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1359489
ZifNab,

I have looked at that component and think I can use it.  If you want to post me an answer, I'll grade it now.  I'll send you some info via email which will explain what I am doing with it.

The reason I thought this was possible was because I have a Win95 game which turns of the eject.  When you press the eject button on the CD-ROM, Windows actually asks me permission to remove the disk because it is in use.

Anyway, thank both of you for your comments and suggestions.

Stuart Johnson.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1359490
Hi Stuart,

                          Not long ago I solved a question, for detecting when a new cd is inserted or a cd is ejected. Maybe this can be a solution for you too. When
                          the user pushes an eject button, you can cancel it. I made a component of it. You can find it on Torry's or Delphi Supe r Page. Look for
                          TCDEVENTS. Offcourse I can also e-mail it to you.

                          http://sunsite.icm.edu.pl/delphi/ 
                          http://torry.rimini.com/ 

                          I'll look this weekend if I can find something to about disabling this event.

                          Please, send me some comments about the component.

Ok for now, but if a program can do it, then we 've to find it out! Don't you think?

                          Regards,
                          Zif.
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1359491
ZifNab,

The unit didn't work on my CD-ROM.  It didn't detect the eject/insert at all (I have a new Mitsumi 24x IDE).  I'll try it on the old Creative CR-582 and see if that works.

The points are awarded anyway.  I got what I needed.  Thanks for that!

Stuart.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359492
Strange, that it didn't worked... I've tried it on several and they all fired an event.

But, what have you founded then? Maybe possible to put it in the component?

Zif.
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1359493
I'll let you know if I discover anything.  The reason for asking for this in the first place was this.  We write education software, all of it running of CD-ROM.  We have found that when students are in a class environment, they tend to do silly things - like eject a CD during the playing of a video.  The teachers have asked if we could do something about it.  However, I found out that it wasnt a priority project and it can wait.  So I'll have a bit of time to find out why your component isn't firing on my drive.

Thanks a million anyway.  Much appreciated.

Stuart.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

912 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now