Is there an easy way to detect if a disc is inserted in the DVD drive? I don’t care what kind of disc (CD, DVD or Blu-Ray)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use WMI to detect if disk in CD/DVD drive:
from here.
DriveType Enumeration can help you what kind of disc:
CDRom: The drive is an optical disc device, such as a CD or DVD-ROM.Fixed: The drive is a fixed disk.Network: The drive is a network drive.NoRootDirectoryThe drive does not have a root directory.Ram: The drive is a RAM disk.Removable: The drive is a removable storage device, such as a floppy disk drive or a USB flash drive.Unknown: The type of drive is unknown.for kind of CD/DVD/Blue-Ray see IMAPI_MEDIA_PHYSICAL_TYPE enumeration:
your code may be like this:
from here.