Article View: borland.public.cppbuilder.nativeapi
Article #3337Re: Detecting media insertion/removal
From: Mike Collins
Date: Tue, 27 Jun 2006 23:34
Date: Tue, 27 Jun 2006 23:34
20 lines
1876 bytes
1876 bytes
As far as I know, what you are seeing is normal, the WM_DEVICECHANGE message is only sent when the hardware device i.e. your reader / writer is inserted or removed, not the media. This is the behaviour that I have observed. It's a dirty hack but you could spawn a thread and use it to attempt a write operation on a certain device - if it fails then you can assume that the card is not present, if it successes that it's there and you can read and write to it. Just a thought. HTH Mike "Mike Wynne" <mikeywyn@hotmail.com> wrote in message news:44a1aa53@newsgroups.borland.com... > > "poojo hackma" wrote... >> Just a thought: Maybe you could store a list of devices that are on the >> system, then whenever you receive a WM_DEVICECHANGE message, look to see >> what is not already in your list (inserts) or what in your list is no >> longer available (removed).
Technical Details
Message-ID:
<44a1c087@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e15854a90a45465d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@TheBottomOfThePost.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com> Subject: Re: Detecting media insertion/removal Date: Wed, 28 Jun 2006 00:34:31 +0100 Lines: 22 Organization: SDA Ltd X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.2663 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2663 NNTP-Posting-Host: 81.2.92.14 Message-ID: <44a1c087@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1151451271 81.2.92.14 (27 Jun 2006 16:34:31 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail