WINDOWS
Know if a window has been rolled up
Does anyone know how to determine whether a window has been rolled up by WindowShade (or the OS8 equivalent)?
What I would like ideally is a function:-
LOCAL FN isWindRolledUp (wndID)
DIM rolledUp
'clever code goes here
END FN = rolledUp
Sure. WindowShade leaves the port rect and clip region alone, but it empties the content region. So just check for
FN EMPTYRGN([windowPtr + _contRgn])
that's all you need.
Works on OS8 and WindowShade both.
and a code snippet that could be used, for example, before checking to change cursors in your window would be:
LONG IF( 0 =FN EMPTYRGN( [windowPtr& +_contRgn])
' do it - window visible
END IF
|