Skip to main content

[archive] Window Positions

  • January 20, 2011
  • 4 replies
  • 0 views

[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

4 replies

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

[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
great thanks for the feedback. Will give it ago and let you know.

Cheers.

[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
great thanks for the feedback. Will give it ago and let you know.

Cheers.

[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
great thanks for the feedback. Will give it ago and let you know.

Cheers.