• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Eject Key Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Eject Key Code


  • Subject: Re: Eject Key Code
  • From: Pascal Pochet <email@hidden>
  • Date: Tue, 27 Jun 2006 19:14:11 +0200


Le 27-juin-06 à 18:17, Mark Stultz a écrit :

I think someone said that this will only work with writeable drives, and I
believe the original author needed regular CD-ROM drives to be compatible.


Mark

On 6/27/06 2:37 AM, "Gerriet M. Denkmann" <email@hidden> wrote:


On 26 Jun 2006, at 23:29, Damien Bobillot <damien.bobillot.2002 email@hidden> wrote:


Casey Fleser wrote :

Check this post:

http://www.cocoabuilder.com/archive/message/cocoa/2004/10/5/118853

The relevant bits of which are:

[really interesting code]

And the tiebreaker question is ;) :
Is there a more direct way to open the CD tray, by using the IOKit by
instance ? It's a bit tricky to simulate a keystroke just to open the
CD tray. If I recall well, the command line tool hdiutil may be used
to open it.



/System/Library/Frameworks/DiscRecording.framework/Versions/A/
Frameworks/DiscRecordingEngine.framework/Versions/A/Headers/ DRDevice.h


has an method:  - (BOOL) openTray; // Commands the device to open
it's tray.

This might be even easier than using the IOKit.

Kind regards,

Gerriet.


Carbon

ParamBlockRec cpb;

memset(&cpb, 0, sizeof(cpb));
cpb.cntrlParam.ioVRefNum = 0;
cpb.cntrlParam.ioCRefNum = driverRefNum;
cpb.cntrlParam.csCode = 7;
PBControlSync((ParmBlkPtr)&cpb) ;

DiskArbitration framework

/*!
* @function DADiskEject
* @abstract Ejects the specified disk object.
* @param disk The disk object.
* @param options The eject options.
* @param callback The callback function to call once the ejection completes.
* @param context The user-defined context parameter to pass to the callback function.
*/


extern void DADiskEject( DADiskRef           disk,
                         DADiskEjectOptions  options,
                         DADiskEjectCallback callback,
                         void *              context );

BSD
ioctl(fd, CDIOCEJECT);


Pascal Pochet email@hidden



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Eject Key Code (From: Mark Stultz <email@hidden>)

  • Prev by Date: RE: Full screen tiny issue
  • Next by Date: Re: Simplest Dongle Method? Making a file uncopyable on CD?
  • Previous by thread: Re: Eject Key Code
  • Next by thread: Simplest Dongle Method? Making a file uncopyable on CD?
  • Index(es):
    • Date
    • Thread