Determine removable disk type
-
How can I determine if an audio CD or DVD is inserted? I already used the sample of detecting a disk being inserted/removed fron CP, but I need to determine i it's a movie or audio disk. I have been searching on Google and Yahoo all morning with no real sucess. Any help would be appreciated. Regards Eric C. Tomlinson
No comment, Mr. Senator
-
How can I determine if an audio CD or DVD is inserted? I already used the sample of detecting a disk being inserted/removed fron CP, but I need to determine i it's a movie or audio disk. I have been searching on Google and Yahoo all morning with no real sucess. Any help would be appreciated. Regards Eric C. Tomlinson
No comment, Mr. Senator
Detect what files are on the disk. If it's an Audio CD, Windows displays the CD data as .wav files (IIRC, it's been a long time since I actually looked - just try it). A movie CD (by which I assume you mean either a VCD or DVD) also contains certain file types. This is actually what Windows Explorer for XP does when you insert CDs. Sometimes it's quick because certain types of files can be detected quickly. Other types, you actually see it searching the disk's content. That's how it determines what items to display in the new Auto Run dialog for Windows XP. Note that Windows Explorer interprets data on an Audio CD differently than other platforms might. The CD is not really comprised of WAV files, but WAV data. It's up to the Window manager or other application to interpret that data and display it as files if so desired. It actually has more to do with file systems than anything.
Microsoft MVP, Visual C# My Articles
-
Detect what files are on the disk. If it's an Audio CD, Windows displays the CD data as .wav files (IIRC, it's been a long time since I actually looked - just try it). A movie CD (by which I assume you mean either a VCD or DVD) also contains certain file types. This is actually what Windows Explorer for XP does when you insert CDs. Sometimes it's quick because certain types of files can be detected quickly. Other types, you actually see it searching the disk's content. That's how it determines what items to display in the new Auto Run dialog for Windows XP. Note that Windows Explorer interprets data on an Audio CD differently than other platforms might. The CD is not really comprised of WAV files, but WAV data. It's up to the Window manager or other application to interpret that data and display it as files if so desired. It actually has more to do with file systems than anything.
Microsoft MVP, Visual C# My Articles
So basically read the drive to determine/set the type of disk. I suspected this but was hoping you could query the system about it after insertion of the disk. I'm going to override the autoplay for certain types of files. Thanks again Heath for the short sweet answer and the good point in the correct direction. Regards Eric C. Tomlinson
No comment, Mr. Senator