Re: Getting the Size of a VIO Window



[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
.



Relevant Pages

  • Re: working set and console applications
    ... I created a windows application and then I created a child console process ... that I started from the parent process using CreateProcess. ... I minimize the child console window it also causes the working set of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Console applications window size
    ... AllocConsole() or AttachConsole. ... You already have a console, ... SMALL_RECT srWindowRect; // hold the new window size ... >exe from a cmd prompt, the same cmd prompt gets bigger properly. ...
    (microsoft.public.vc.language)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ...     ByVal hWnd As IntPtr, ...     End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: vb6 run from and output to command window
    ... VB doesn't really create true console applications (because the linker ... allocate the console window, and read/write from/to it. ... Private Declare Function AllocConsole Lib "kernel32" As Long ... Dim lResult As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Prevent Domain Users From Browsing Around in Active Directory?
    ... View, Customize, uncheck everything except the top one that says Console ... But they will have the rt-click feature. ... Rt-click on that OU, new window from here. ...
    (microsoft.public.windows.server.active_directory)