Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!ox.com!heifetz!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.sys.mac.programmer Subject: Re: Excel 3.0 and the WindowList Message-ID: <1CE00001.he2hp6@tbomb.ice.com> Date: 5 Jun 91 15:44:00 GMT Reply-To: time@ice.com Organization: ICE Engineering, Inc. Lines: 50 X-Mailer: uAccess - Mac Release: 1.5 In article <72724@microsoft.UUCP>, benw@microsoft.UUCP (Ben WALDMAN) writes: > >I'm trying to do something similar to what "PopWMenu" does (programatically). > > > >However, "goofy stuff" isn't an acceptable result of user actions in this > >case. The 'phantom' windows found in Excel can be filtered out because they > >have no title. (Only real strings belong in a text list anyway.) My problem > >is that the "regular" windows in Excel aren't "regular" at all. Calling > >_SelectWindow on them screws things all up (read: Bus Error). "PopWMenu" and > >other similar things just call _SelectWindow, as I would have liked to do. > > > >Anybody from Microsoft who would care to explain their "windows" to me? > > There's nothing unusual about the regular Excel windows. The "weirdness" > that is going on here is that we maintain the several floating windows > by using SendBehind rather than SelectWindow (that is, to bring a window > to the front, it is sent behind the rear-most floating window). If you > do this, your program should work (there are 4 floating windows). Also, > I'm not sure that it's a good idea to check for title strings, since the > frontmost floating window will get a title when printing, in order to get > this name to appear in various print manager dialogs. > > Ben Waldman > Excel Development Team > Microsoft The current stream of conciousness appears to believe that the best means of dealing with Floating windows in Applications in general is to start at the *end* of the WindowList and work backwards until you find a window that is active (visible && hilited). This window is considered the "active document" and if it is not the FrontWindow(), then the remaining windows are considered floating. I am not sure how well this works with various apps, but investigation has shown it will work with many. The "SendBehind()" should work if you send the window behind the "Back Floating Window", or the first floating window in the list above the "active document". The biggest catch is when an application is maintaining some list about the order of their windows in another array, and get "caught" when you change the order in the WindowList, but their array does not change. tim. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208