[comp.sys.mac.programmer] How can a desk accessory find application windows?

momtahan@leibniz.uucp (Parham Momtahan) (08/09/89)

I am developing a DA that has to know the title of the application 
window that is active when the DA is launched, and I am having 
trouble obtaining the window pointer. Any suggestions?

BTW, I have attempted calling the "FrontWindow" function prior to 
creating the DA's own window in order to obtain the window pointer. 
However, it turns out that the "WindowList" global is nilled out 
when a DA is launched, presumably by the Desk Manager.Consequently 
"FrontWindow" returns nill.

I am rather stumped! Any help would be gratefully appreciated.

Parham Momtahan (Bitnet: momtahan@bnr.ca | Phone: 613-765-4673 ) 
Computing Research Laboratory, Bell-Northern Research Ltd.,
PO Box 3511, Station C, Ottawa, Ont K1Y4H7, Canada.                            

sdh@wind.bellcore.com (Stephen D Hawley) (08/09/89)

In article <1405@bnr-fos.UUCP> momtahan@leibniz.uucp (Parham Momtahan) writes:
[wants to get title of frontmost window]

Does your DA open a window?  If so, open it, and grab the nextWindow field
of your DA's window record.  This will be the next window under yours,
which is probably (but not guaranteed to be) the application's window.

Steve Hawley
sdh@flash.bellcore.com
"Up is where you hang your hat."
	--Jim Blandy, computer scientist