?
Solved

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

Posted on 2003-03-11
7
Medium Priority
?
450 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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Technology Partners: 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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

616 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