Solved

List of all USB Ports on a Computer

Posted on 2003-11-14
12
498 Views
Last Modified: 2010-04-05
Does anyone know how I can get all of the USB Ports installed on a comoputer.
0
Comment
Question by:ramoreia
  • 4
  • 4
  • 3
  • +1
12 Comments
 
LVL 2

Expert Comment

by:Kalroth
Comment Utility
I'm pretty sure Robert Marquardt's library/component can do this for you or at least help you doing so. :-)

Look at http://www.delphi-jedi.org/ -> Open Source API Library -> Microsoft Human Input Device.
The sourcecode link is ftp://delphi-jedi.org/api/hid.zip

Good luck.
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 250 total points
Comment Utility
The link is http://www.delphi-gems.com/controls.php :-)

Your question is unanswerable though.
The USB port is nonexistent. Like ethernet the bus itself is invisible. Only devices are visible.
The number of available ports can also change because plugging an USB hub adds new ports.
Windows also hides the fact that you can have several USB buses.
A modern PC comes with at least three of them. One USB 2.0 two USB 1.1.
Adding another one through a PCI card is cheap and easy.
0
 
LVL 6

Expert Comment

by:DaFox
Comment Utility
ramoreia,

See NTDDK/src/wdm/usb/usbview for an example.

Markus
0
 
LVL 11

Expert Comment

by:robert_marquardt
Comment Utility
Yes, USBVIEW from the Windows DDK can show the tree of the devices, but there are drawbacks.
The assignment of port numbers of a hub and the physical layout of the ports need not match.
The API is not guaranteed by Microsoft (something i learned in the MS driver newsgroup).
0
 

Author Comment

by:ramoreia
Comment Utility
What´s USBVIEW ???? What I want is something in Delphi. If theres a way.
0
 
LVL 11

Expert Comment

by:robert_marquardt
Comment Utility
USBVIEW is an example program from the Windows DDK and of course written in C.
There is no program for showing the USB device tree in Delphi.
I know because i would have written it.

Can you please explain for what you need it?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 6

Expert Comment

by:DaFox
Comment Utility
>> What´s USBVIEW ???? What I want is something in Delphi.

Hello? Are you a programmer or a typist? Sorry, but I cannot understand you behavior, I just wanted to help...
Anyway, Robert is the usb guy. I hope he has the right answer for you.

Regards,
Markus
0
 

Author Comment

by:ramoreia
Comment Utility
DaFox,
 First of all, that´s not the way to talk to anyone. Second, you should ask things before judging someone. I don´t have alot of experience in programing ok, and that´s why i´m asking. What i didn´t get in what you said is . What is " NTDDK/src/wdm/usb/usbview " that you mentioned.
0
 
LVL 6

Expert Comment

by:DaFox
Comment Utility
I didn't mean to offend you, ramoreia. It's okay that you don't have a lot of experience in programming. Everyone starts as a novice. But if you are interested in such complicated topics you cannot expect to get full Delphi source code. You have to get into this topic by reading lots of specs and ask others that already dealt with it. Nevertheless, I apologize for my overreaction.

To your question:
There are 2 main developer kits offered by Mircrosoft, the PSDK (Platform Software Development Kit) and the WinDDK (Device Driver Kit). Both kits are the perfect source for getting information on Windows programming and they also include some samples. If you install them you always have a directory .../src/... inside the kit's install directory. So, by "NTDDK/src/wdm/usb/usbview" I meant the sample from the NTDDK/WinDDK in .../wdm/usb/usbview.

Regards,
Markus
0
 

Author Comment

by:ramoreia
Comment Utility
Thank you. Where can I download these development kits ? Hey, we are all here not just to help someone but for learning too. Agree.
0
 
LVL 11

Expert Comment

by:robert_marquardt
Comment Utility
The Win DDK is not for download you get it from Microsoft as CD for a shipping fee.
0
 
LVL 6

Expert Comment

by:DaFox
Comment Utility
The DDK used to be free, but as Robert said, you have to subscribe to MSDN to get it now. Maybe you can find it on some book cds...
You can download the PSDK here: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/default.htm

Markus
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now