Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!caen!etsu!cmi.com!dave From: dave@cmi.com (David Halonen) Newsgroups: comp.sys.mac.programmer Subject: Re: Determine the foreground application Message-ID: <5180@etsu.CMI.COM> Date: 17 Oct 90 12:28:51 GMT References: <1990Oct11.003039.459@ifi.uio.no> Sender: news@etsu.CMI.COM Organization: Center for Machine Intelligence, EDS Corp. Lines: 16 How can a background app come to the front, perform some task and then return the previous app to the front? On a Mac. Easy. DrawMenuBar gets called as each app makes a major context switch. Patch that sucker to keep track of who was on top before your app gets there and then do a OpenDeskApp on that name. When DrawMenuBar is called, currAppName has the appropriate name filled in. We've had great success with this. Of course w/ System 7, a patch won't be necessary - I believe. Now you get to work out the details of a meaningful interface. Which means why can't the Notification Mgr be used? David Halonen, Center for Machine Intelligence, Electronic Data Systems Ann Arbor, MI (313) 995-0900 AppleLink: N0548 Internet: dave@cmi.com