How to detect Floppy Arrival
-
Hamid. wrote:
I think its not good way but he can uses of SetCurrentDirectory check return value if its nonzero it has floppy.
But you have to poll regularly for that.. i don't think thats good design and could present user headache, as if floppy is corrupt, it could hang the system!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Well I said its not good idea but I dont think it hang the system.
-
VC_RYK wrote:
i want to detect Floppy arrival but 'WM_DEVICECHANGE' does not work for floppy so is there anyway to detect Floppy arrival.
Actually Floppy Drive doesn't work the way CD Drive work. I mean, you could simply put Floppy in the drive, but to make Computer aware you have to click on floppy icon, which is not in case of cd drive. thats just my logical conclusion!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
PC floppy drives have (or used to have) a active low Disc Change line, which went high (
1
) when the drive was empty and was low (0
) when a disc was inserted. Not sure if/how you can get direct access to that line on Win32, though... Maybe there is an LVM routine that can be used? Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles -
Well I said its not good idea but I dont think it hang the system.
Hamid. wrote:
Well I said its not good idea but I dont think it hang the system.
well you have to test that yourself ;P try putting corrupt floppy into your computer and acess it through My COmputer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Hamid. wrote:
Well I said its not good idea but I dont think it hang the system.
well you have to test that yourself ;P try putting corrupt floppy into your computer and acess it through My COmputer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
I dont use of floppy disk.;P
-
Hi guys i want to detect Floppy arrival but 'WM_DEVICECHANGE' does not work for floppy so is there anyway to detect Floppy arrival. with regards RYK
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
nave [OpenedFileFinder]
-
I dont use of floppy disk.;P
Hamid. wrote:
I dont use of floppy disk.
USe ZIP Drive then ;P
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
nave [OpenedFileFinder]
Naveen.R wrote:
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
Hi Naveen, could you please help me in finding out the exact WMI Class , which could help me in this purpose.. it could work as wonderfull tip for my FAQ site. if you allow i will publish that with you name. Thanks Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Hamid. wrote:
I dont use of floppy disk.
USe ZIP Drive then ;P
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Ok:laugh:
-
Naveen.R wrote:
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
Hi Naveen, could you please help me in finding out the exact WMI Class , which could help me in this purpose.. it could work as wonderfull tip for my FAQ site. if you allow i will publish that with you name. Thanks Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
I saw two classes
Win32_FloppyController/Win32_FloppyDrive
. -
Naveen.R wrote:
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
Hi Naveen, could you please help me in finding out the exact WMI Class , which could help me in this purpose.. it could work as wonderfull tip for my FAQ site. if you allow i will publish that with you name. Thanks Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
ThatsAlok wrote:
could you please help me in finding out the exact WMI Class
Any thing for you sir :) Actaully I tried this for one of my project requirment. I used the
ExecNotificationQueryAsync()
function with the following query.HRESULT hres = pSvc->ExecNotificationQueryAsync( _bstr_t("WQL"), _bstr_t("SELECT *" "FROM __InstanceOperationEvent WITHIN 1 " "WHERE TargetInstance ISA 'Win32_LogicalDisk'"), WBEM_FLAG_SEND_STATUS, NULL, pStubSink );
And in the notification handler we can check the instance is __InstanceCreationEvent and __InstanceDeletionEvent for any drive arrival or removal. But if you want disk arrival or removal you may need to handle the __InstanceModificationEvent( this one i didnt check ).nave [OpenedFileFinder]