🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #15893

Re: Detecting Quits.

#15893
From: Darin Adler
Date: Mon, 04 May 1987 22:22
29 lines
1851 bytes
In article <850@runx.ips.oz>, betz@runx.ips.oz (Andrew Betzis) writes:
>SkipFinder (DA) = BlockMove (detected a BlockMove of FinderName -> CurAppName)
>Locator (DA) = ExitToShell
>Launch (FKEY) = CloseResFile (detected when refNum = CurApRefNum)

Early versions of SkipFinder used the BlockMove trap to catch exits to
the Finder.  Later, I switched to the "OpenResFile" trap.  This
technique is used by SkipFinder, Sequencer, the MiniFinder, and the
MPW Shell and is fairly stable.  The check is for an OpenResFile call,
from the ROM (return address > ROMBase), with a file name that is the
same as "FinderName".  Once you detect what is going on, you can start
over with a new launch, or open a different resource file and continue.

Intercepting ExitToShell does not work in all cases.  Intercepting
BlockMove is stupid (it's called too often).  The only call to
OpenResFile that the ROM makes is from the Launch (and Chain) routine,
and this has never changed, in the Mac, Mac Plus, Mac SE, or Mac II
ROMs.

Of course, these days, it's smarter to read the new Apple Tech Note,
and do it with a call to SubLaunch.

By the way, contrary to what you might think, the new launch calls
will not make all the old transfer menus stop working.
--------
Darin Adler
"You can't reach me on UseNet."
AppleLink: D0144
GEnie: DADLER
Technical Details
Message-ID: <5129@ut-ngp.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!awd
References: <850@runx.ips.oz>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!awd
From: awd@ut-ngp.UUCP (Darin Adler)
Newsgroups: comp.sys.mac
Subject: Re: Detecting Quits.
Message-ID: <5129@ut-ngp.UUCP>
Date: Mon, 4-May-87 18:22:50 EDT
Article-I.D.: ut-ngp.5129
Posted: Mon May  4 18:22:50 1987
Date-Received: Tue, 5-May-87 05:33:20 EDT
References: <850@runx.ips.oz>
Organization: UTexas Computation Center, Austin, Texas
Lines: 29
Summary: Wrong about SkipFinder