Getting window id for certain process id (for sharing the application)

Getting window id for certain process id (for sharing the application)

Post by selv » Wed, 19 Dec 2007 18:54:32


Hi all,

My question is very very old. Lot of people may know answer for this.
Still i could find anything useful for my problem.

These are the questions asked by many people but i couldn't find
anything useful in googling.

Is there a way to obtain a list of window-IDs that belong to a certain
process? (ie retrieving window IDs/pointers/whatever by PID numbers).

Can I know in any way to obtain the window id of the top-level window
of a running X-application based on its process id.?

Objective:
To Collect all the window id's for certain process to share those
windows across network. The user input will be PID. I need to find out
the windowid's related to that particular PID.

Please suggest me.
 
 
 

Getting window id for certain process id (for sharing the application)

Post by ebenZEROON » Thu, 20 Dec 2007 04:07:25

In article < XXXX@XXXXX.COM >,


xlsclients -l | grep ^Window | cut -f 2 -d ' ' | cut -f 1 -d :

will do it for one screen. You may have to add "-a" for multiple
screens, unless I've screwed up the args. One C solution is

system("xlsclients -l | grep ^Window | cut -f 2 -d ' ' | cut -f 1 -d :")

There may be a nicer way.

--
-eben XXXX@XXXXX.COM http://www.yqcomputer.com/ :81
"God does not play dice" -- Einstein
"Not only does God play dice, he sometimes throws
them where they can't be seen." -- Stephen Hawking