How to list Com Port usage and list of devices using those ports
-
Hello All, I need help for the following subject: I will insert a HW into usb port of my PC, and I want my program to automatically detect the HW and give me the Port Name (or number) and some inforrmation about the inserted HW? Thanks,
-
Hello All, I need help for the following subject: I will insert a HW into usb port of my PC, and I want my program to automatically detect the HW and give me the Port Name (or number) and some inforrmation about the inserted HW? Thanks,
I can direct you to the correct subject to search for ... search for Serial Port and WMI ... I know that there are WMI classes can help you to play with Serial Port and USB ... here is a link to an article about USB Port insert and remove ... http://www.codeproject.com/script/Forums/Edit.aspx?fid=1649&select=2809641&floc=/script/Forums/View.aspx&fa=r[^] I used WMI for serial before ... but was long time ago ... wish you luck ..
Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.
-
I can direct you to the correct subject to search for ... search for Serial Port and WMI ... I know that there are WMI classes can help you to play with Serial Port and USB ... here is a link to an article about USB Port insert and remove ... http://www.codeproject.com/script/Forums/Edit.aspx?fid=1649&select=2809641&floc=/script/Forums/View.aspx&fa=r[^] I used WMI for serial before ... but was long time ago ... wish you luck ..
Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.
Hi, Write WndProc in the code and check for device attached/detached event.(There is one event for this. Try to search on net.) After getting event write a code to read registry for com port information. When an device is plugged to USB port an entry is made in the registry.
HKEY_LOCAL_MACHINE/DEVICEMAP/SERIALCOMM
So, you can listen for the changes in this key. And will get to know com port at which device is attached.