Technote TB 05 | February 1991 |
Inside Macintosh, Volume I-299, documents the declaration of the window definition function (WDEF) as follows:
FUNCTION MyWindow(varCode: INTEGER; theWindow: WindowPtr; message: INTEGER; param: LONGINT) : LONGINT;
On the first examination of the parameters, one may assume param always contains a long value; however, when the system is calling the WDEF with message = wDraw, it only stores a short value in param without clearing the high-order word of param. If the high-order word contains any value other than zero, the content of param is different from what the WDEF expects.
For the custom WDEF to work correctly, it should use only the low-order word of param when message = wDraw.
Note: This problem exists in all systems up to and including System Software 7.0. The suggested fix is valid for all of these systems.