A desk accessory can own (and open) multiple windows. The following methods
for doing this are taken from information in "Inside Macintosh Volume I" on
page I-109. (This article assumes you are familiar with the basics of
resources.)
The resource ID of a WIND resource shows ownership. The following ranges
are used for this purpose:
Range
-32768 to -16385 reserved
-16384 to -1 used for owned resources
0 to 127 used for other system resources
128 to 32767 Not owned
The range to look at is -16384 to -1. To decipher the owner information,
view the individual bits in the resource ID:
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 type bits owning resource id you set these bits
Bits 14 and 15 are always 1. Bits 11 to 13 define the OWNING resource
type. In the case of a desk accessory, they would be 000, which indicates a
DRVR resource. Bits 5 to 10 specify the OWNING resource ID in the range of
0 through 63. Bits 0 to 4 are set by you. Thus, you can have up to 32
different OWNED resources of the same type for a desk accessory. For
example, a WIND resource with ID -16000:
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
1 1 type bits owning resource id you set these bits
|--------------------|
|
12
This WIND resource is owned by a DRVR resource with ID 12. If the WIND
resource ID is -15599, then you have:
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1
1 1 type bits owning resource id you set these bits
|--------------------|
|
24
You can access these WIND resources through the standard window manager
calls.