Consultor Eletrônico



Kbase P10845: How to minimize or maximize a window using the WINDOW-STATE attribute
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/7/2007
Status: Verified

GOAL:

How to programmatically resize a window to full screen?

GOAL:

How to programmatically maximize a window to whole screen?

GOAL:

How to programmatically minimize a window?

GOAL:

How to minimize or maximize a window using the WINDOW-STATE attribute

GOAL:

How to programmatically restore a window that has been minimized by a user?

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

A programmer often wants to minimize or maximize a PROGRESS window within the 4GL. This can be accomplished using the WINDOW-STATE attribute.

This attribute is an integer and accept 1, 2 and 3 as value:
1) WINDOW-MAXIMIZED - The window has been maximized to fill the entire display.
2) WINDOW-MINIMIZED - The window has been minimized (iconified).
3) WINDOW-NORMAL - The window is in the "restored" state. Initially, this refers to a state that is neither maximized nor minimized. However, setting WINDOW-STATE to WINDOW-NORMAL restores the window to its previous state, which may be the maximized, minimized, or neither.

For example, the following statement will minimize the currently active window:

CURRENT-WINDOW:WINDOW-STATE = WINDOW-MINIMIZED.

Before doing this, it might be advisable to save the handle of the current window to a variable so that the windows original state can be restored at a later point in the code.