when i put cdrom in drive windows identifys it automaticaly.

i am writting a program, and i need the program to identify the cd the minute i enter it into the drive, just like windows does...

now, i know how to get the info from the cd on a command click. i dont need that, what i do need is the code that identifies the cd when i put it in.