Highlighted
Absent Member.
Absent Member.
629 views

[archive] Window Positions

[Migrated content. Thread originally posted on 20 January 2011]

Hi There,

I am using Extend 9.0.0 at the moment and am looking at ways to position floating windows dynamically.

I have a form with many fields. Each of the fields has a button which when pressed calls another separate program. This program (helppgm), displays a hierarchial menu in its own floating window.

When helppgm is displayed, it displays in the centre of the main window. Is there a way to display it in the vicinity of the pressed button (control-value) that initiated the call ?

Thank-you.

Julie
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Positions

There is an option with the DISPLAY WINDOW where you can specify screen location, e.g.:
DISPLAY WINDOW SCREEN LINE 300 SCREEN COLUMN 300.
As you can tell, this is in base units (pixels).

But how to find the 300, 400?

Well, suppose you have a handle to the button in question, you can do something of the following:
77 SystemHandle PIC X(4) COMP-N.
01 Rect.
    03 Pos-left PIC X(4) COMP-N.
    03 Pos-top PIC X(4) COMP-N.
    03 Pos-right PIC X(4) COMP-N.
    03 Pos-bottom PIC X(4) COMP-N.

Inquire for the buttons window handle:
INQUIRE button-handle SYSTEM-HANDLE IN SystemHandle.
call "[EMAIL="user32.dll@WINAPI"]user32.dll@WINAPI[/EMAIL]".
CALL "GetWindowRect" USING BY VALUE SystemHandle BY REFERENCE RECT.
DISPLAY WINDOW SCREEN LINE POS-TOP SCREEN COLUMN POS-LEFT.


I haven't tried this, but in theory it should work, let me know if it does. 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Positions

great thanks for the feedback. Will give it ago and let you know.

Cheers.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.