Auto Detection / Notification of Inserted Media (CD)
Category:C#, VB.NET, ASP.NET
Version Compatibility: Visual Basic.NET
This code shows how we can intercept windows form messages to detect the insertion or removal of a CD. Along with System.Windows.Forms.Message, this project uses System.Runtime.InteropServices to implement this functionality. Be sure to add a listBox control to your form before running the application.
Instructions: Copy the declarations and code below and paste directly into your VB project.