Code needs to be alerted that a removable disk drive's state changed

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I check to see if the Floppy drive is ready and display it's state.

But if the user inserts or removes a floppy disk I need an event or
Windproof
message to cause the code to display the new state.

Is the some way the code can be alerted to the fact that a removable disk
drive's state changed?



Thanks
 
There is probably something that does this directly but I would consider
putting any reads/writes to any drive inside a try/catch/finally loop. If
the file can't be written/read, an exception will be thrown that contains the
reason why (e.message).
 
I wonder if I wasn't clear as to what I need.
Think of Windows Explorer like app showing
31/2 Floppy (A:) {Not Ready}

If the floppy "ready" state changes I need to be notified so that the
display can be changed.

I could, for example, have a timer tick event periodically check the drive
but hope that is not the only way to do it.

Thanks
 
You can just start a thread the checks the drive status periodically then
raises an event to notify your main thread or set the status appropriately.
I don't think there is an event raised when a disk is removed or inserted.
 
Back
Top