Detect disc in drive
BlitzMax Forums/BlitzMax Beginners Area/Detect disc in drive
| ||
Is there a way to detect whether or not there is a disc in a dvd drive? I have looked at the documentation and done a number of searches on the forum, but found nothing. Does anyone have an example, some code, which shows how to find out if there is a disc in the drive? It can be windows specific, because I only need this for something running on windows. [edit] It looks like GetVolumeInformation winApi function will do the trick. I found a thread where the user Grable had posted a conversion of this extern. And when using it, if the volume label is empty, then there is no disc in the drive, unless ofcause someone made a cd/dvd without a label, which I haven't tried out to be honest. But who makes discs without labels anyways? I know I don't. The code Grable wrote can be found here: http://www.blitzmax.com/Community/posts.php?topic=68452#764890 If there is a simpler solution, I would still like to know about it, but until then, this will do. |
| ||
Brucey has a Volumes mod whichwill retun a bunch of info for different drives in the system. |
| ||
I did know about Brucey's mod, but for this task I did not want to include a complete mod, but just what was needed to do this one specific task, which is why I didn't go for his mod. |
| ||
I did know about Brucey's mod, but for this task I did not want to include a complete mod, but just what was needed to do this one specific task, which is why I didn't go for his mod ??Brucey's Volumes mod is tiny. |
| ||
I've got some nice OS X code that raises an event when you insert something (like a CD/USB stick/etc) :-) |