RE: CD eject

new topic     » topic index » view thread      » older message » newer message

> I'm wondering if anyone has a code (windows) that will access a CD-ROM 
> drive and make it eject.? Thanks!
> 

I saw Juergen Luethje's code snip for ejecting a CD using INTs.  Very 
interesting.  If however you would prefer the Windows version of the 
same, use this:

==========
include Win32Lib.ew

constant
winmm = registerw32Library( "winmm.dll" )
constant
mciSendString = registerw32Procedure( winmm, "mciSendStringA", 
{C_POINTER,C_POINTER,C_POINTER,C_POINTER} )

procedure OpenCD()
    atom OpenStr
    OpenStr = allocate_string( "Set cdaudio door open wait" )
    w32Proc( mciSendString, {OpenStr, 0, 0, 0} )
    free( OpenStr )
end procedure

procedure CloseCD()
    atom CloseStr
    CloseStr = allocate_string( "Set cdaudio door closed wait" )
    w32Proc( mciSendString, {CloseStr, 0, 0, 0} )
    free( CloseStr )
end procedure
==========

Don Phillips

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu