Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!matthews From: matthews@eleazar.dartmouth.edu (Jim Matthews) Newsgroups: comp.sys.mac.programmer Subject: Re: Checking for MF (was Re: Need some MF help) Message-ID: <12904@dartvax.Dartmouth.EDU> Date: 5 Apr 89 13:35:32 GMT References: <1562@neoucom.UUCP> <28689@ucbvax.BERKELEY.EDU> <1179@internal.Apple.COM> Sender: news@dartvax.Dartmouth.EDU Reply-To: matthews@eleazar.dartmouth.edu (Jim Matthews) Distribution: comp.sys.mac.programmer Organization: Dartmouth College, Hanover, NH Lines: 22 I don't have any good reasons for wanting to detect MultiFinder's presence, but I would like a call to find out whether my program is in the background. I know about suspend and resume events, but I want to find out where my program is *right now*. The reason is that it's easy to drop a suspend or resume event, particularly when ModalDialog or one of the Alert calls is getting the events. It's uncommon for major switching to occur with a modal dialog is in front, but it isn't impossible -- the foreground application can quit, and setting startup to multiple applications can cause it also. Dropping one suspend or resume event can leave the application out of synch for a long time, with ugly effects in terms of cursor tracking, notification of asynchronous events, and other application-specific things. One alternative is to compare my name to CurApName, but it isn't impossible for the user to run two identically-named programs. So is there a sure-fire way to tell whether I'm in background, or any plans to provide one? Jim Matthews Dartmouth Software Development