Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Drag Manager and windowKind 20

Q When I drag from my application into a Finder window, the system crashes. I noticed Finder uses a windowKind value of 20 for its windows, and so does my app. When my app avoids windowKind 20, everything's hunky-dory. What gives?

A Through the Drag Manager, Finder has gotten access to the windows in your app's window list (specifically, by using undocumented calls to obtain the source window of a drag). If your window's windowKind field is 20, Finder assumes the window is one of its own (as opposed to a driver window, whose windowKind would be negative, or a dialog window, whose windowKind would be 2, etc.). Finder grabs the value in the window's refCon field and type-casts it to a pointer to a C++ object in Finder's heap. I think you can see where this is going: when Finder attempts to dereference the pointer, various crashing behaviors result.

The upshot of this Finder bug is that your application should not use windowKind values of 20.

[Nov 27 1996]