473,805 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2123
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****@discuss ions.microsoft. com> wrote in message
news:A9******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. com> wrote in message
news:A9******** *************** ***********@mic rosoft.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
451
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 : Please insert the disk : Microsoft .NET Framework (English) : OK Cancel Pressing the OK button will check the floppy drive for a disk and
3
1771
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 new state. Is the some way the code can be alerted to the fact that a removable disk drive's state changed? I wonder if the above isn't clear.
171
7826
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) like it because you can split the code from the design. That is logical. But if you are the only one working on the code, it seem a little overkill. I use Dreamweaver to do my design and find it a bit of a hassle to have multiple files open...
0
346
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 state. Is the some way the code can be alerted to the fact that a removable disk drive's state changed?
0
1074
by: Allen | last post by:
Dim DiskMO As New ManagementObject("win32_logicaldisk.DeviceID=""" & sDrive & """") Then using DiskMO("DriveType") Case DRIVE_TYPES_REMOVABLE snip...
3
3897
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 write and maintain one program for both Linux and Windows. Each platform uses different functions so even if I could find two platform dependent functions that would be fine. Basically, I would like to avoid checking fixed disks if possible. If...
7
2293
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 other details about the media itself? thanks Glenn
1
1751
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 modules. The modules have been duplicated and thus the need to change the serial number on each one. My approach is to use a USB to IDE adapter cable and write a C# routine which will automate the writing of the serial #. At this point, I have a...
4
2910
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 with a message. How do I write this little control function in Visual Basic regards pjl
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10369
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.