473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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

Nov 21 '05 #1
3 2087
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).

"Just Me" wrote:
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

Nov 21 '05 #2
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
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
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).

"Just Me" wrote:
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

Nov 21 '05 #3
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.

"Just Me" wrote:
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
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
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).

"Just Me" wrote:
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


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff Liao | last post by:
Hi all, I am trying to install the .NET framework 1.1 runtime package on Windows 2000 SP4. While the installation starts well, I get the following message box during the installation process :...
3
by: Just Me | last post by:
In code 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 a Wndproc message to cause the code to display the...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
0
by: Just Me | last post by:
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 WindProc message to cause the code to display the new...
0
by: Allen | last post by:
Dim DiskMO As New ManagementObject("win32_logicaldisk.DeviceID=""" & sDrive & """") Then using DiskMO("DriveType") Case DRIVE_TYPES_REMOVABLE snip...
3
by: Mike Joyce | last post by:
I am trying to write a portable script that will find removable media, such as compact flash, sd card, usb, etc. drive and then upload files from the media. I want this to be portable so that I can...
7
by: glenn | last post by:
Hi can anyone tell me how given a directory or file path, I can pythonically tell if that item is on 'removable media', or sometype of vfs, the label of the media (or volume) and perhaps any...
1
by: Jim Flanagan | last post by:
Hello - I am in need of more help regarding an approach to accomplishing the following: We have a need to change the Volume serial numbers of a bunch of preprogrammed IDE Solid State Drive...
4
by: Per Juul Larsen | last post by:
Hi my VB program must always start from a removable disk. In addition, on the removable media to be images of the type *. jpg *. tips. If not the two conditions are present, the programme will end...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.