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.
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.