FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

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

Robert


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.

Mars


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

jonathan