Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Problem: getting strucRgn/contRgn of invisible windows Message-ID: <48582@apple.Apple.COM> Date: 28 Jan 91 23:13:24 GMT References: <3839@uakari.primate.wisc.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 30 In article <3839@uakari.primate.wisc.edu> bin@primate.wisc.edu (Brain in Neutral) writes: >I want to do some window positioning, taking into account the >size of the window *including* the window frame - i.e., I want >to use the strucRgn and not portRect. (Why? Well, suppose you >want to position a window so that the title bar doesn't come >under then menu bar. Then you need to know how tall the title >bar is.) > >Trouble is, the strucRgn (and contRgn) fields of invisible >windows seem to be empty. I thought at first that it was just >a matter of the regions not being calculated until the window >was shown, but after some messing about, it appears that >the regions are set empty when windows are hidden, as well. > >Any way to determine the strucRgn of an invisible window? MacApp does this by saving off the contents of those fields, calling the WDEF directly with the wCalcRgns message, looking at the results, and then restoring the old contents of the fields. I'll bet Larry Rosenstein wrote that code. We've never had to change it... -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions