Re: Getting the Size of a VIO Window
- From: Ilya Zakharevich <nospam-abuse@xxxxxxxxx>
- Date: Thu, 13 Sep 2007 20:39:58 +0000 (UTC)
[A complimentary Cc of this posting was sent to
J de Boyne Pollard
<j.deboynepollard@xxxxxxxxx>], who wrote in article <1189683737.839903.84300@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
IZ> On OS/2, there is absolutely no problem to find the PM window
handle
IZ> associated to the PID of a process running in a VIO window. (I do
not
IZ> know what you mean by a VIO handle.)
IZ> Many programs do it. E.g., see Perl's
OS2::Process::process_hwnd().
The approach taken by that library function is the facile one that I
suspected someone would think of. I investigated that approach back
when I wrote the 32-bit Unicode Console API. It doesn't work
correctly. I strongly urge you to think about the issue a lot more
thoroughly than you have. You can start by thinking about what IDs
and handles are actually stored in the task list (The TASKLIST and
WINSIGHT utilities from the OS/2 Command Line Utilities provide easy
access to the relevant information.) and thinking about what
information an arbitrary TUI process wanting to know the size of the
console window that it is writing to actually posesses in all cases.
Then you need to think hard about what you've erroneously assumed,
clear from what you write above, about the relationships between
processes and sessions, and between sessions and tasklist entries.
Thanks. I already did the exercises you suggest. The library is
thoroughly tested. If you KNOW some case were it would not work,
please let us know.
Otherwise people who know your history of posting to this newsgroup
would simply discard your postings, taking them as unsubstantiated
insinuations.
The simple fact of the matter is as I stated before: There's simply no
way for a TUI, or even a GUI, process to reliably relate a VIO handle
to a Presentation Manager window.
The process above reliably relates PID to HWND.
Not only is there no API for doing so, IBM OS/2 doesn't actually
have the concept of console windows in the first place.
(Full-screen sessions don't have any such things, for example. This
is in contrast to full-screen consoles in Win32, which have console
windows and allow the screen buffer to be larger than the display
hardware size.) It's not possible to reliably obtain the correct
information in order to fake them properly in a shim.
Thanks, I can extract the needed information in all the cases. See
code of OS2::Process.
Enjoy,
Ilya
.
- References:
- Getting the Size of a VIO Window
- From: CyberSimian
- Getting the Size of a VIO Window
- From: J de Boyne Pollard
- Re: Getting the Size of a VIO Window
- From: Ilya Zakharevich
- Getting the Size of a VIO Window
- From: J de Boyne Pollard
- Getting the Size of a VIO Window
- Prev by Date: Re: Getting the Size of a VIO Window
- Next by Date: Re: Getting the Size of a VIO Window
- Previous by thread: Getting the Size of a VIO Window
- Next by thread: Re: Getting the Size of a VIO Window
- Index(es):
Relevant Pages
|