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