PDA

View Full Version : Question about Dvd and CD media


autoplmst6
10-18-2008, 04:06 AM
Hi:

I have tested with success a little function for ejecting dvd and cd drive that were inbox in the media drive, but can`t find in help file any action or built-in function for introducing via script (logically you have to put fisically the dvd first...) or software so that unattendely the system insert dvd in you pc...Is there any way to do this?

If is there any variable or so for referring to inserting dvd in pc, if so... How It should be written in AMS correctly?

Thanks!

jassing
10-18-2008, 11:01 AM
Hi:

I have tested with success a little function for ejecting dvd and cd drive that were inbox in the media drive, but can`t find in help file any action or built-in function for introducing via script (logically you have to put fisically the dvd first...) or software so that unattendely the system insert dvd in you pc...Is there any way to do this?

If is there any variable or so for referring to inserting dvd in pc, if so... How It should be written in AMS correctly?

Thanks!

So you want to script a "close drive" as well as "open drive"?

Not all drives support "close".
I've seen some drives respond to the "eject" command (when open) to close
it.

Here's some vb code that might work for you (convert to lua/IR)

Private Declare Function mciSendString Lib “winmm.dll” Alias “mciSendStringA” (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer

mciSendString(“set cdaudio door open”, 0, 0, 0)
mciSendString(“set cdaudio door closed”, 0, 0, 0)

But remember, not all drives support close... (ala laptops)

Do a google search for "api close dvd tray"

autoplmst6
10-19-2008, 09:58 AM
Hi Jassing:

I have tested this sample using the dll action script for this dill (winmm.dll) before I was looking first in this forum and compiled until I got it;

I attached the apz for a better idea according the vb scripts you gave me for this exercise, why do you say that perfoming this action it wouldn't supprot all kind manufacturer drives (lg, samsung, ...)?

What problems do you had experienced with calling the winmm.dll?

jassing
10-19-2008, 10:03 AM
why do you say that perfoming this action it wouldn't supprot all kind manufacturer drives (lg, samsung, ...)?

some drives do not support being closed. Take a laptop's drive -- the 4 laptops we have here, not one supports being closed automatically; it must be manually shut.