Article View: borland.public.cppbuilder.nativeapi
Article #9655Re: How to determine that CD-drive is empty?
From: Bob Gonder
Date: Mon, 28 Jun 2004 17:41
Date: Mon, 28 Jun 2004 17:41
36 lines
2367 bytes
2367 bytes
Simon Macneall wrote:
>I'll have a play with the IDiscRecorder amd Removable Storage Manager
>stuff, but it isn't overly likely that the drive we will be trying to
>open/close is a recorder, and while our main deployment will be XP, we
>have to work on 2k as well...
I don't remember if you ever explained why you care which state the
door is in.
Generally, you have a button that the user presses to cycle the
door, and rely on the user not to be too braindead to know the
difference. (hmmm..that could be tasteless if you are doing this for
handicap reasons)
Ok, so app starts.
Three possabilities
1) CD in. Read it and go.
2) No CD. Wait for user to push button.
3) Door Open. Wait for user to push button.
3.5) User closes door manualy (with CD) catch WM_DEVICECHANGE.
If this is some sort of security thing, once you have a CD in, keep
the info that the door is closed. And then lock the door so only you
can open it.
Door=Unknown;
while( cannotreadfiles )
{
if( WM_DEVICECHANGE )
continue;
if( button push )
{ cycle door()
if( Door != Unknown )
Door ^= Opened^Closed;
}
}
Door=Closed;
Technical Details
Message-ID:
<6rk0e054fa2r2lkjqns62rabm4q93mqdf4@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40da83a0$1@newsgroups.borland.com> <40dab6f4$1@newsgroups.borland.com> <40dabd59$1@newsgroups.borland.com> <opr94ibay12nqexn@lightyear> <opr94juib12nqexn@lightyear> <40dbc351$1@newsgroups.borland.com> <opr940rkqc2nqexn@lightyear> <74mnd0t561o702vk69e3mugo3jjndn3n85@4ax.com> <opr9907xlv2nqexn@lightyear>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d00920f15dfe8a59 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How to determine that CD-drive is empty? Date: Mon, 28 Jun 2004 10:41:10 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <6rk0e054fa2r2lkjqns62rabm4q93mqdf4@4ax.com> References: <40da83a0$1@newsgroups.borland.com> <40dab6f4$1@newsgroups.borland.com> <40dabd59$1@newsgroups.borland.com> <opr94ibay12nqexn@lightyear> <opr94juib12nqexn@lightyear> <40dbc351$1@newsgroups.borland.com> <opr940rkqc2nqexn@lightyear> <74mnd0t561o702vk69e3mugo3jjndn3n85@4ax.com> <opr9907xlv2nqexn@lightyear> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.99.248 X-Trace: newsgroups.borland.com 1088444468 69.69.99.248 (28 Jun 2004 10:41:08 -0700) Lines: 39 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail