Consultor Eletrônico



Kbase P119644: Cannot grow window past main monitor size when using multiple monitors
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

SYMPTOM(s):

Using multiple monitors

Using dual screen setup

Trying to span window across multiple screens

Window automatically resized to fit in main screen

Cannot set window size larger than first screen

Issue does not appear when using Windows version before XP and 2000

CAUSE:

This is a known limitation of Progress and OpenEdge in Windows 2000, Windows XP and later versions of Windows.
To set SESSION:WIDTH-PIXELS and SESSION:HEIGHT-PIXELS, Progress call the Windows AP GetSystemMetrics(SM_CXSCREEN) and GetSystemMetrics(SM_CYSCREEN) to get the size of the screen. However since Windows 2000 and Windows XP these metrics return only the size of the primary monitor.

FIX:

To work around this issue, the new Windows API can be used to compute the total size of the display.
Here is an example 4GL code:
&GLOBAL-DEFINE SM_CXVIRTUALSCREEN 78
&GLOBAL-DEFINE SM_CYVIRTUALSCREEN 79
PROCEDURE GetSystemMetrics EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER nIndex AS LONG.
DEFINE RETURN PARAMETER nRet AS LONG.
END PROCEDURE.
DEF VAR test_win AS WIDGET-HANDLE.
DEF VAR VirtWidth AS INTEGER.
DEF VAR VirtHeight AS INTEGER.
/* Get the size of the virtual screen from Windows */
RUN GetSystemMetrics({&SM_CXVIRTUALSCREEN}, OUTPUT VirtWidth).
RUN GetSystemMetrics({&SM_CYVIRTUALSCREEN}, OUTPUT VirtHeight).
/* SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN are not supported
** on NT, so ask Progress for the screen values (SM_CXSCREEN and
** SM_CYSCREEN).
*/
IF VirtWidth = 0 THEN VirtWidth = SESSION:WIDTH-PIXELS.
IF VirtHeight = 0 THEN VirtHeight = SESSION:HEIGHT-PIXELS.
CREATE WINDOW test_win
ASSIGN
THREE-D = YES
TITLE = "MizziSoft Test Window".
CURRENT-WINDOW = test_win.
DISPLAY "SM_CXVIRTUALSCREEN: " VirtWidth .
DISPLAY "SM_CYVIRTUALSCREEN: " VirtHeight .
/* Realize the window */
test_win:VISIBLE = YES.
/* CREATE WINDOW limits MAX-WIDTH-PIXELS and MAX-HEIGHT-PIXELS
** to SESSION:WIDTH-PIXELS and SESSION:HEIGHT-PIXELS. We have
** to set them after the window is realized to avoid this
** limitation.
*/
ASSIGN
test_win:MAX-WIDTH-PIXELS = VirtWidth
test_win:MAX-HEIGHT-PIXELS = VirtHeight.

WAIT-FOR WINDOW-CLOSE OF test_win.