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

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
 
G

Guest

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).
 
J

Just Me

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top