?
Solved

CD-ROM HW name and CD-ROM open/close detection

Posted on 2003-03-11
7
Medium Priority
?
449 Views
Last Modified: 2010-04-04
Hi every1.

Well... I am not as good in Delphi as you all experts, so this is why am I asking this question. I just need to determine if a CD-ROM is opened or closed but don't have any idea how to do it. I know open it or close it or so, but can not determine if it is opened or even closed.

Second problem I have is that I want to know a HW name of my CD-ROM but don't want to read registry values to know it. So is there any function that can determine a HW name of it?

THX for all anything.

CyberGhost
0
Comment
Question by:CyberGhost
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8111052
For door open/close get the DBT conversion from http://delphi-jedi.org/APILIBRARY
The enumeration of devices goes through Setup API. Get my HID component from http://www.delphi-gems.com/controls.php
It contains an example to enumerate the HID devices. It should be usable to enumerate the CD-ROMs also. You only need the correct GUID. No guarantee though.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 8134434
0
 
LVL 6

Author Comment

by:CyberGhost
ID: 8135726
These are my remarks:

1, I have tried all of your ideas. On that last page (http://eo-soft.addr.com) is just a program which detects your drives (and LABELS not HW NAME or so... so nothing what I want).

2, previous remarks - OPEN/CLOSE is that what I can do. But I can NOT DETECT if it is OPENED or CLOSED. Maybe u didn't understand what I mean. I just want to DETERMINE if it is opened or closed.

3, I CAN enumerate the CD-ROM drives in my PC. That is not a problem. Just one thing what I want to know is, if there is some API function (or so) which can I use to find out HARDWARE (HW) name (fe. TEAC 2521 TC or so... - just an example). I know that this is written in registry but it is on other places when using WIN9X and WINXP...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8135847
AFAIK the info you see in device manager is collected by SetupDiGetDeviceRegistryProperty. So you will have to enumerate the CD-ROM devices with the SetupDi functions. You are well into driver API then. Maybe the driver newsgroup of msnews.microsoft.com can help you to match driver with drive letter.

AFAIK detect if physically open or closed is impossible.
This can be an internal firmware state which may not be available even to the driver.
So "no CD closed" and "open" is all the same.
0
 
LVL 6

Author Comment

by:CyberGhost
ID: 8151549
Do nor say it is impossible. Is this experts-exchange, or not? Sorry... not meaning personal. But I am almost hopeless.
Is it really impossible?
0
 

Expert Comment

by:modulo
ID: 8224643
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/CleanUp/Q_20563555.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 8239403
Saving this Q as a PAQ and refunding the points to the questionner

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question