Auto Detection / Notification of Inserted Media (CD)

Category:
C#, VB.NET, ASP.NET
Type:
Modules
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic.NET

More information:
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.

Declarations:

Code: