Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

COM port useage

Posted on 2003-10-23
5
Medium Priority
?
205 Views
Last Modified: 2013-11-15
Is there a way to return the program that is using a selected com port.

I want to be able to tell a user which program they need to close to release the com port so my program can then use it.

Thanks

Adrian Wood
0
Comment
Question by:adeshere2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 252 total points
ID: 9605471
You'd have to find the handle for the open port and then find which application uses this handle. This is some very deep API functionality and I'm not sure if you can access this quite easily...
Or perhaps you have to enumerate all applications, all handles per application and see if the handle is linked to the COM port...
0
 
LVL 8

Assisted Solution

by:gmayo
gmayo earned 248 total points
ID: 9605493
I don't know of any direct way and have never seen a program do that, including MS ones. However, a COM port handle is the same as any other file handle. So if you can go through each process/thread and determine which handles it owns, then maybe you can find out who actually owns it. I don't know if that is possible though.

Geoff M.
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9605835
About enumerating handles owned by an application, the Handle.exe at http://www.sysinternals.com/ntw2k/freeware/handle.shtml seems to be able to do this. An application HandleEx is also part of the Windows 2000 Resource kit. Unfortunately, no sourcecode available...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
Curious about the latest ransomware attack? Check out our timeline of events surrounding the spread of this new virus along with tips on how to mitigate the damage.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

715 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