Consultor Eletrônico



Kbase P138938: How can I tell if a window is truly maximized from an MS Windows perspective?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/19/2008
Status: Unverified

GOAL:

How can I tell if a window is truly maximized from an MS Windows perspective?

GOAL:

How can I tell if a window is truly maximized when WINDOW-STATE says it is maximized but it really isn't?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

The following code shows how, via Windows API calls, to tell if a window is truly maximized from an MS Windows perspective.

procedure IsZoomed external "user32":
define input parameter hWindow as long.
define return parameter iResult as long.
end procedure.
procedure GetParent external "user32":
define input parameter hWindow as long.
define return parameter iResult as long.
end procedure.

define variable iResult as integer no-undo.
define variable iParent as integer no-undo.

run GetParent ({&window-name}:hwnd, output iParent).
run IsZoomed (iParent, output iResult).

if iResult = 0 then
message "Maximized = False" view-as alert-box.
else
message "Maximized = True" view-as alert-box.