Window handles
Features of the handle
In the past window handles have always been related to the internal window structure by a known algorithm. As of Wimp 5.93, this algorithm will no longer be used. There should be no clients which access the internal Wimp structures, so this should not be an issue.
Features of the previous algorithm were used by certain clients for their internal functioning, although this was never documented. For completeness, the following is true of the new algorithm and the old :
- Bit 0 will always be set.
This feature can be used in traversing menu structures. A menu pointer with bit 0 set is actually a window handle.
- Bit 31 will never be set.
This feature has been used to check that the window handle is valid by never being negative.
- The handle will never be 0, -1, -2, or -3.
These values may be safely used by clients to indicate the non-existance of a window internally. The special values -1, -2 and -3 are used by some interfaces to indicate iconbar, top, bottom and hidden windows. These values actually fall into the above two categories, but are explicitly documented here for clarity.
Despite being documented here, clients should not rely on the window handle having any meaning where possible.
|