BBC BASIC for Windows
« Serial comms: identifying open ports »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Serial comms: identifying open ports  (Read 763 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Serial comms: identifying open ports
« Thread started on: Mar 1st, 2015, 06:22am »

I am still try to resurrect a half-completed project to identify serial ports that have been opened by apps running on a Windows machine.

The desired output will be a listing showing, for each opened port, the name of the app that opened the port. Something like this:
Code:
COM4    C:\Program Files\app\app.exe
COM200  C:\xyz\myapp.exe
CNCA123 C:\abc\anotherapp.exe
 


This is straightforward to do manually using Sysinternals Process Explorer, but I want to do it programmatically in BB4W.

So far in BB4W I have been able to identify the Windows device name for each serial port. For example:
Code:
COM4 = \Device\ProlificSerial0
COM200 = \Device\VSPE_SERIAL200
CNCA123 = \Device\com0com11
 


and in BB4W I can list the running processes on the system, using CreateToolhelp32Snapshot. Problem is, I am missing the necessary WINAPI system call(s) that will let me associate the device names with the processes.

I have spent many hours Googling the Microsoft WINAPI pages and various forums, but have drawn a blank.

Hints anyone?

--
Ian
User IP Logged

AndrewCool
New Member
Image


member is offline

Avatar




PM


Posts: 8
xx Re: Serial comms: identifying open ports
« Reply #1 on: Feb 29th, 2016, 11:28pm »

Hi Ian,

Would you be willing to share the BB4W code that produces this output?

COM4 = \Device\ProlificSerial0
COM200 = \Device\VSPE_SERIAL200
CNCA123 = \Device\com0com11

For my purposes that info is just dandy!

TIA,

Andrew
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls