FutureBasic Logo

<<    Index    >> FutureBasic 5

get window   statement



Syntax:
get window [#]wndID, windowPtrVar&

Description:
This statement returns a pointer to the window record for the window specified by wndID. The pointer is returned into windowPtrVar& , which must be a long-integer variable or a pointer variable. A window record is a data structure which contains information about the window, such as its current visibility status, current background & foreground colors, and much, much more. In addition, you need to specify a window record pointer whenever you call any Toolbox routine that deals with windows.
FutureBasic uses the window record's RefCon field to maintain information about the window, including its class, its modality (modal or not), its ID number, and its type. This information is only valid for windows created using the window statement. You can access this information as follows:
refCon& = windowPtr&.wRefCon&
class = (refCon& and &FF)
isModal = ((refCon& and &FF00) <> 0)
windowID = (refCon& and &FF0000) >> 16
windowType = ((refCon& and &FF000000) >> 24) + 1


Note:
Your program should not dispose of the window record (i.e., don't pass the pointer to fn DISPOSPTR). The system automatically disposes of it when you close the window.

See Also:
window statement; window function