I uses an exe program that can do a variety of things depending on the contents of an ini file.
for example .:
Prog.exe txtfile1.ini does one thing (a program window opens)
Prog.exe txtfile2.ini does another thing (another application window opens)
Prog.exe txtfile3.ini performs another different thing (another new window opens)
For each new occasion, a new process (Prog.exe) is started in the activity manager.
Not uncommon to 2-10 Prog.exe has been started, according to the program manager.
But all of them have the same name Prog.exe in the program manager.
Some are started manually, others automatically (24 hours - 7 days a week)
If AHK has started Prog.exe, it is no problem to get information about PID etc., but the other processes ....
Is it, in any way, possible to analyze which Prog.exe are started (the window name or something)?
More information about a specific process / program
Re: More information about a specific process / program
Think the best way is to iterate through all active processes containing the name "prog" . Get their (unique) window handles, and then obtain their corresponding PIDs. If a "prog" is yet to start implement a listener.
As for getting the command line parameters used to start the process, WMI looks attractive.
As for getting the command line parameters used to start the process, WMI looks attractive.
itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
Re: More information about a specific process / program
May be I dont understad?lmstearn wrote: ↑13 Dec 2018, 07:42... iterate through all active processes containing the name "prog" . Get their (unique) window handles, and then obtain their corresponding PIDs. If a "prog" is yet to start implement a listener….
I have tested different methods but failed to get any information about just "Prog.exe".
All I've found is Number of Processes and PID.
Nice program, but the only information I got is .:lmstearn wrote: ↑13 Dec 2018, 07:42As for getting the command line parameters used to start the process, WMI looks attractive.
Process one!
- CPU
- PrivateBytes(20 884K)
- Working Set(40 900K)
- PID (4932)
and (right now)
Process two!
- CPU
- PrivateBytes(21 904K)
- Working Set(39 436K)
- PID (4992)
And "ToolTip" information "Path: [Access Denied]" on both processes
Re: More information about a specific process / program
Best bet is to iterate through all processes and get their PIDs. Once the PID's are known get the window handles. Then iterate through the list to extract all window handles that correspond with "prog.exe" using WinGet.
As for the command line parameters, WMI has to be used, There may be some AHK examples of this around "hidden" somewhere, sorry can't help with that.
However, if you have three processes only and AHK starts two of them, you can log the PIDs and handles of the AHK ones. Later, when iterating through the three "prog" processes, the one with the PID & handle not logged must be the one not started by AHK script.
Another more "costly" option is to watch for new "prog" processes by taking periodic snapshots of the process list and comparing with the last snapshot- logging the new "prog" process details. Good luck!
As for the command line parameters, WMI has to be used, There may be some AHK examples of this around "hidden" somewhere, sorry can't help with that.
However, if you have three processes only and AHK starts two of them, you can log the PIDs and handles of the AHK ones. Later, when iterating through the three "prog" processes, the one with the PID & handle not logged must be the one not started by AHK script.
Another more "costly" option is to watch for new "prog" processes by taking periodic snapshots of the process list and comparing with the last snapshot- logging the new "prog" process details. Good luck!
itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
Who is online
Users browsing this forum: Google [Bot], inseption86, Rohwedder, william_ahk and 168 guests