Rxwinexec returns the PID for the task started. I need to get the window object or the window title associated with the PID. Anyone have ideas on how to do this? Thanks
On 1/14/2018 11:01 AM, Garry Smithwick wrote:
Rxwinexec returns the PID for the task started. I need to get the window object or the window title associated with the PID. Anyone have ideas on how to do this? Thanks
I have a routine to see if Thunderbird is running or not. It uses the windows utility "tasklist" that gets all running sessions. The first
column is the app name, the second is the PID. My routine looks for the Name, but you could easily modify it to look for the PID and return the
file name for that PID.
/**************************************************************************************************
* FUNCTION: Check_Tbird
* Use DOS Tasklist.exe to get running tasks, and pipe through rxqueue. *
If Thunderbird.exe is active, return "YES" to calling function. **************************************************************************************************/
Check_Tbird: Procedure
TBird = "NO"
TBird_Que = rxqueue("Create")
rc = rxqueue("set",TBird_Que)
"tasklist | rxqueue" TBird_Que
i=1
do queued()
pull aline.i
if pos("THUNDERBIRD.EXE",aline.i) >0 then TBird = "YES"
i=i+i
end
Call rxqueue "DELETE", TBird_Que
Return TBird /****************************************************************************************************************/
--
Jack
Tolerance is the virtue of the man without convictions.
http://jbstein.com
On Monday, January 15, 2018 at 10:10:47 AM UTC-5, Jack wrote:
On 1/14/2018 11:01 AM, Garry Smithwick wrote:
Rxwinexec returns the PID for the task started. I need to get the window object or the window title associated with the PID. Anyone have ideas on how to do this? Thanks
I have a routine to see if Thunderbird is running or not. It uses the
windows utility "tasklist" that gets all running sessions. The first
column is the app name, the second is the PID. My routine looks for the
Name, but you could easily modify it to look for the PID and return the
file name for that PID.
/**************************************************************************************************
* FUNCTION: Check_Tbird
* Use DOS Tasklist.exe to get running tasks, and pipe through rxqueue. *
If Thunderbird.exe is active, return "YES" to calling function.
**************************************************************************************************/
Check_Tbird: Procedure
TBird = "NO"
TBird_Que = rxqueue("Create")
rc = rxqueue("set",TBird_Que)
"tasklist | rxqueue" TBird_Que
i=1
do queued()
pull aline.i
if pos("THUNDERBIRD.EXE",aline.i) >0 then TBird = "YES"
i=i+i
end
Call rxqueue "DELETE", TBird_Que
Return TBird
/****************************************************************************************************************/
--
Jack
Tolerance is the virtue of the man without convictions.
http://jbstein.com
I have a routine like that also. However, that will not get me the window object or the window title associated with the PID.
Yes, tasklist list gives me lots of data, but not the windowobject. The challenge is to get the windowobject
using the PID and then get the window title using the windowobject. In other words, given the PID of a task,
what is the window title associated with that PID?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 62:07:55 |
Calls: | 6,488 |
Calls today: | 1 |
Files: | 12,096 |
Messages: | 5,274,518 |