I found sample code and was able to get a drive to eject or load, but what I really need the program to do is perform the operation based on the drive's current state. i'm using the DeviceIoControl function to send commands to my device. The problem i'm having is I don't know which command to send to get status info back for the tray.
the DeviceIoControl function is defined in winioctl.h
for alittle more detail, i'm trying to make an app that will eject/load a drive based on its state. For now this app is just going to run once and terminate. In the end, I want it to sit in the system tray or run in the background and check for a certain keypress to execute the load/eject function. My idea behind this is the F12 button in OS X that ejects a CD if you hold the button for afew seconds.
If there is an easier way of doing this, please let me know!
Question
Fonze
I found sample code and was able to get a drive to eject or load, but what I really need the program to do is perform the operation based on the drive's current state. i'm using the DeviceIoControl function to send commands to my device. The problem i'm having is I don't know which command to send to get status info back for the tray.
the DeviceIoControl function is defined in winioctl.h
for alittle more detail, i'm trying to make an app that will eject/load a drive based on its state. For now this app is just going to run once and terminate. In the end, I want it to sit in the system tray or run in the background and check for a certain keypress to execute the load/eject function. My idea behind this is the F12 button in OS X that ejects a CD if you hold the button for afew seconds.
If there is an easier way of doing this, please let me know!
thanks :D
Link to comment
Share on other sites
6 answers to this question
Recommended Posts