🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9649

Re: How to determine that CD-drive is empty?

#9649
From: Simon Macneall
Date: Sun, 27 Jun 2004 23:36
37 lines
2590 bytes
On Fri, 25 Jun 2004 01:05:25 -0700, Bob Gonder  
<notbg@notmindspring.invalid> wrote:

>
> Is IDiscRecorder of any help?
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/idiscrecorder.asp
> See also
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/rsm_media_change_detection.asp?frame=true
> Hmm.. both XP solutions.....
>
>
> Also see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/detecting_media_insertion_or_removal.asp?frame=true
> Talks about WM_DEVICECHANGE
> And
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/device_management_control_codes.asp?frame=true
>
>

Thanks for the links...

WM_DEVICECHANGE will only tell you if a disc is inserted, not the tray  
close with no disc. Also to use it you have to assume a state at  
application launch (ie, assume that there is no disc in the drive until  
you get told otherwise).

I tried the device management control a week or so ago, using  
IOCTL_CHANGER_GET_STATUS I could also only tell if there was a disc in the  
drive or not, not the actualy tray state.

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...

Thanks
Simon
Technical Details
Message-ID: <opr9907xlv2nqexn@lightyear>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d00920f15dfe8a59
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to determine that CD-drive is empty?
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>
Message-ID: <opr9907xlv2nqexn@lightyear>
Date: Mon, 28 Jun 2004 07:36:59 +0800
From: "Simon Macneall" <macneall@iinet-dot-net-dot-au>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
User-Agent: Opera M2/7.51 (Win32, build 3798)
NNTP-Posting-Host: 203.153.243.50
X-Trace: newsgroups.borland.com 1088379287 203.153.243.50 (27 Jun 2004 16:34:47 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail