[comp.sys.mac.programmer] variation code of WDEF's

sonenbli@oxy.edu (Andrew D. Sonenblick) (09/09/90)

I have figured out how to get the Variation code necessary to call
a WDEF from my own code, but I am wondering if there is/will be
a way to get at the code in a 32-clean environment.  Currently the
code resides in the hi byte of the defProc handle in the window
record...  but of course, like the handle attributes, they go
somewhere else in a 32 enviro... does anyone know where or how to
access it...

mystone@mondo.engin.umich.edu (Dean Yu) (09/11/90)

In article <109540@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes:
>I have figured out how to get the Variation code necessary to call
>a WDEF from my own code, but I am wondering if there is/will be
>a way to get at the code in a 32-clean environment.  Currently the
>code resides in the hi byte of the defProc handle in the window
>record...  but of course, like the handle attributes, they go
>somewhere else in a 32 enviro... does anyone know where or how to
>access it...

  A new call, _GetWVariant, was introduced with System 4.2 which returns the
variation code of the window you pass to it.  You should definitely use this
call all the time instead of looking at the high byte of the defProcHandle.

_______________________________________________________________________________
Dean Yu                            | E-mail:    mystone@mondo.engin.umich.edu
Patches 'R' Us                     | Real-mail: Dean Yu
A Division of Cyberite Systems     |            909 Church St Apt C
                                   |            Ann Arbor, MI 48104
  I speak for myself, so I'm not   | Phone:     313 662-4073
   going to disclaim anything.     |            313 662-4163
-------------------------------------------------------------------------------

stevec@Apple.COM (Steve Christensen) (09/12/90)

In article <109540@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D Sonenblick) writes:
>I have figured out how to get the Variation code necessary to call
>a WDEF from my own code, but I am wondering if there is/will be
>a way to get at the code in a 32-clean environment.  Currently the
>code resides in the hi byte of the defProc handle in the window
>record...  but of course, like the handle attributes, they go
>somewhere else in a 32 enviro... does anyone know where or how to
>access it...

If all you want to do is find out what the window variant is, you can call
the GetWVariant routine [FUNCTION GetWVariant(whichWindow:WindowPtr):INTEGER
or  pascal short GetWVariant(WindowPtr whichWindow) ].  According to Inside
Mac volume 5, this is available in the Plus and on.  If you want to set the
variant, I'll leave that as an exercise for the reader, however suffice to
say that it's all described in IM5...

steve

-- 
______________________________________________________________________________

  Steve Christensen             Internet:   stevec@goofy.apple.com
  Apple Computer, Inc.          AppleLink:  STEVEC
  20525 Mariani Ave, MS 81-CS   CompuServe: 76174,1712
  Cupertino, CA  95014

  "You just contradicted me."  "No I didn't."
______________________________________________________________________________