Solved

List of all USB Ports on a Computer

Posted on 2003-11-14
12
502 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 214
JAudiorecorder record freezing the app 29 67
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 34
update joined tables 2 45
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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