Solved

List of all USB Ports on a Computer

Posted on 2003-11-14
12
506 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
ID: 9747086
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
ID: 9747197
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
ID: 9749270
ramoreia,

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

Markus
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9749916
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
ID: 9780202
What´s USBVIEW ???? What I want is something in Delphi. If theres a way.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9780671
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
 
LVL 6

Expert Comment

by:DaFox
ID: 9781860
>> 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
ID: 9818863
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
ID: 9819795
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
ID: 9823842
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
ID: 9824476
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
ID: 9825618
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View Settings Question 15 116
Base1 Encode/Decode 3 82
DBGrid or StringGrid ? 6 105
Slow Restore if incremental backups using RDiff.exe 4 31
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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