session:work-area-height-pixel problem

Posted by Blake Stanford on 06-Sep-2017 09:41

All,

I'm attempting to set the size of an ABL window to the maximum size of the work area, when I have the windows task bar set to not hide.

When I use the following code to set the window size, the ABL window is larger than the work area and part of the window is below the windows task bar.   

ASSIGN
{&WINDOW-NAME}:WIDTH-PIXELS =  SESSION:WORK-AREA-WIDTH-PIXELS
{&WINDOW-NAME}:HEIGHT-PIXELS = SESSION:WORK-AREA-HEIGHT-PIXELS.

If I subtract 44 from the height, the ABL window displays correctly, nothing below the windows task bar.

ASSIGN
{&WINDOW-NAME}:WIDTH-PIXELS =  SESSION:WORK-AREA-WIDTH-PIXELS
{&WINDOW-NAME}:HEIGHT-PIXELS = SESSION:WORK-AREA-HEIGHT-PIXELS - 44.

I came up with 44 by maximizing the window with the max button, checking its height via a message statement, then subtracting it from the session:work-area-height-pixels.  NOTE: The maximized window always honors the windows taskbar.

Am I missing or misunderstanding something about the work-area?

OpenEdge 11.6.2
Windows 10

Thx,
Blake

All Replies

Posted by Matt Gilarde on 06-Sep-2017 09:50

You can set MAX-WIDTH-CHARS and MAX-HEIGHT-CHARS to ? (unknown) and set WINDOW-STATE to WINDOW-MAXIMIZED. OpenEdge will automatically set the size to fill the work area.

DEF VAR ww AS HANDLE.
CREATE WINDOW ww ASSIGN
  MAX-WIDTH-CHARS = ?
  MAX-HEIGHT-CHARS = ?
  WINDOW-STATE = WINDOW-MAXIMIZED.
    
ww:VISIBLE = YES.
WAIT-FOR GO OF ww.

Posted by Blake Stanford on 06-Sep-2017 10:34

Yes that would work, however, I don't always want the window to open maximized.  Part of the problem I'm trying to solve is when our customers are using a screen resolution that is smaller than the window sized.  When the screen resolution is such that the defined window size will display completely then we wouldn't want it maximized.

This thread is closed