Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!caen.engin.umich.edu!mystone From: mystone@caen.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Re: Saving window position question Message-ID: <44478f0b.1285f@maize.engin.umich.edu> Date: 7 Jul 89 15:43:00 GMT References: <505@suna.CMI.COM> Reply-To: mystone@sol.engin.umich.edu Distribution: usa Organization: Computer Aided Engineering Network, University of Michigan Lines: 40 Sender: Followup-To: In article <505@suna.CMI.COM> maryd@suna.CMI.COM (Mary Dimercurio) writes: > >Hi! I am trying to make my application "MultiFinder friendly." Tech >note 158 suggests that I should save the positions of the windows that >I have open so that they will go where the user had them last when the >application is launched again. Unfortunately it doesn't say HOW I can >do this. How do I get the location of my windows to save (I plan to >save them in a resource)?? > It's quite simple. Say you have a window pointer theWindow. You can get the global coordinates of the window by windowPeek(theWindow)^.contRgn^^.rgnBBox To make life simple, it you might want to declare a type to store your window rectangles in: TYPE windRec = RECORD saveRects: array [1..maxWindows] of Rect; END; windRecPtr = ^windRec; windRecHand = ^windRecPtr; Now you've got a handle you can store in a resource after a trivial type coercion. _______________________________________________________________________________ Dean Yu | E-mail: mystone@{sol,caen}.engin.umich.edu University of Michigan | Real-mail: Dean Yu Computer Aided Engineering Network | 909 Church St | Apt C ===================================| Ann Arbor, MI 48104 | Phone: Given on a need to know basis, and "I am the Merit Host. I speak for | only if you're going to offer me a the bitstream." (In other words, | job... these are my very own opinions; | my employer wants to have nothing |=========================================== to do with them, or me.) | This space available for rent -------------------------------------------------------------------------------