On Tue, 16 Sep 2003, Owen Taylor wrote:

>> >   i am new in Xwin programming. I made an enumwindow function. For 
>> > each visible window i get a Window structure. My main consern is to get 
>> > the process id of the window and i am puzzled the way i should terminate 
>> > that process if necessery.
>> 
>> To elaborate on Mark's response, the REASON you cannot get a process ID for a 
>> given window is that, in the X world, that window might have been generated by 
>> a program on an entirely different computer, running an entirely different 
>> operating system, across the network.
>
>That being said, the ICCCM defines the WM_CLIENT_MACHINE property:
>
>WM_CLIENT_MACHINE(STRING) = "poincare.devel.redhat.com"
>
>and the freedesktop.org WM spec defines the _NET_WM_PID property:
>
>_NET_WM_PID(CARDINAL) = 23397
>
>So, if the toolkit that creates the window supports these
>specifications, you can find out the client machine and process ID.

The concept of a PID however is not portable across all operating
systems 100%.  Also there's the issue of 16bit vs. 32bit PID, or
perhaps 64bit PID even.  It's also likely some OS's out there
don't have a concept of a PID, such as running Desqview/X on an
MSDOS system.  Granted, that's an unlikely scenario in modern
times, but I'm not sure relying on a PID being available or
relying on a POSIX type of OS being on the remote system is a
good idea.

-- 
Mike A. Harris

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to