Consultor Eletrônico



Kbase P14304: How to center a window on the screen in MS-Windows.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   24/01/2005
Status: Unverified

GOAL:

How to center a window on the screen?

GOAL:

How to center a window on the screen independently by the screen resolution.

FACT(s) (Environment):

Windows 32 Intel
Windows NT 32 Intel/Windows 2000

FIX:

For a "normal" window you should insert the following code in the "Main Block" section immediately before the "RUN enable_UI" statement.

For a "smart" window you should insert the following code in the "initialize-object" override procedure before the default behavior.

ASSIGN {&WINDOW-NAME}:X =
(SESSION:WIDTH-PIXELS - {&WINDOW-NAME}:WIDTH-PIXELS) / 2
{&WINDOW-NAME}:Y =
(SESSION:HEIGHT-PIXELS - {&WINDOW-NAME}:HEIGHT-PIXELS) / 2.