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.
You may attempt to combine xlsclients and xprop to query the value of
the _NET_WM_PID property of each top-level window. That could be made
either by means of a shell/perl script or even writing your own
program. You can get the source code of xlsclients and xprop here:
http://webcvs.freedesktop.org/xorg/xc/programs/xlsclients/xlsclients.c
http://webcvs.freedesktop.org/xorg/xc/programs/xprop/xprop.c
Be warned, however, that not all clients will set the _NET_WM_PID
property.
---
Casantos