Sign in to follow this  
Followers 0
Richard Robertson

CDTray

10 posts in this topic

How do you eject and uneject media? I understand DeviceIoControl, and I found IOCTL_STORAGE_EJECT_MEDIA. I'm not sure why it's not working. How does AutoIt do it?

Share this post


Link to post
Share on other sites



CDTRAY("R:","Open")

if R: is the drive letter of the CDROM drive

Share this post


Link to post
Share on other sites

@Larry: Thanks

@jpm: I was asking about the C++ code, I understand CDTray(...) in AutoIt.

Share this post


Link to post
Share on other sites

Got a VBScript code for you wich seeks ur cd's and ejects em...

Set WMP = CreateObject("WMPlayer.ocx")
Set colCDROMS = WMP.CDROMCollection

If colCDROMS.Count > -1 Then
      For i = 0 to colCDROMS.Count - 1
            colCDROMS.Item(i).Eject
      Next
End If

Write This into a *.vbs and have fun

Share this post


Link to post
Share on other sites

I'm using C++. Nice of you to offer the code though. Would any of that work in C++ do you think?

Share this post


Link to post
Share on other sites

@Larry: Thanks

@jpm: I was asking about the C++ code, I understand CDTray(...) in AutoIt.

I was thinking we were on an AutoIT Forum ...

Share this post


Link to post
Share on other sites

@jpm: Sorry; I was asking in the Developer section about something AutoIt does. If I had a question about how to use CDTray, it would have been in "Support."

@tonedeaf: I would need to sign up for that. It looked like it would have helped though.

Share this post


Link to post
Share on other sites

@jpm: Sorry; I was asking in the Developer section about something AutoIt does. If I had a question about how to use CDTray, it would have been in "Support."

@tonedeaf: I would need to sign up for that. It looked like it would have helped though.

THat's OK but Dev forum is usually around something to be developp with or in AutoIT

Cheers :o

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0