Getting window id for certain process id (for sharing theapplication) - X

This is a discussion on Getting window id for certain process id (for sharing theapplication) - X ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Getting window id for certain process id (for sharing theapplication)

  1. Getting window id for certain process id (for sharing theapplication)

    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.

  2. Re: Getting window id for certain process id (for sharing theapplication)

    In article <2267ec5d-68e1-4e6e-b17d-7e88209ef985@d4g2000prg.googlegroups.com>,
    selva wrote:
    > 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.


    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 QebWenE01R@vTerYizUonI.nOetP http://royalty.mine.nu: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

+ Reply to Thread