From dmurdoch at pair.com  Thu Jul 15 22:39:18 2004
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Thu Jul 15 22:39:19 2004
Subject: [Rd] getWindowsHandle()
In-Reply-To: <Pine.GSO.4.58.0407151559590.14948@uni01du.unity.ncsu.edu>
References: <Pine.GSO.4.58.0407151559590.14948@uni01du.unity.ncsu.edu>
Message-ID: <g5qdf0tqb7dvvrdorqqlbg6ool5309p28c@4ax.com>

On Thu, 15 Jul 2004 16:13:51 -0400 (EDT), Peng Liu
<pliu3@unity.ncsu.edu> wrote :

>I notice that this function is available after Dr. Murdoch's post at
>R-GUI. I am further wondering how to use "Process" and "ProcessID" two
>choices. Suppose I created more than one 'Document' windows within MDI. I
>need to find their corresponding process ID or handle, in order to
>communicate with them correctly.

You'll need to read Windows documentation.  

The difference between Process and ProcessID is that one is the result
of a call to the GetCurrentProcess function, and the other is the
result of a call to the GetCurrentProcessID function. 

Currently R has no way to get the list of MDI document windows.  I
think the function you want is EnumChildWindows, but you might need to
use EnumWindows.  I can't remember whether MDI documents are child
windows or top level windows.

If you do get all of this worked out nicely, contributions of patches
to R would be welcomed.  The file where this function lives is
src/gnuwin32/extra.c.

Duncan Murdoch


[Rd] getWindowsHandle()
Duncan Murdoch