Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!zephyr.ens.tek.com!tektronix!reed!chaffee From: chaffee@reed.UUCP (Alex Chaffee) Newsgroups: comp.sys.mac.programmer Subject: Re: Shutdown Manager Message-ID: <13905@reed.UUCP> Date: 19 Jan 90 23:07:38 GMT References: <1990Jan16.193431.28545@eplrx7.uucp> <1409@smurf.ira.uka.de> Reply-To: chaffee@reed.UUCP (Alex Chaffee) Organization: Reed College, Portland OR Lines: 38 In article <1409@smurf.ira.uka.de> urlichs@smurf.ira.uka.de (Matthias Urlichs) writes: < Finder/Multifinder (right now, the stupid dialog appears for every Restart <>< as well as every Shutdown). <>< <>Install something with sdOnUnmount to load the resources, stash their handles ,>somewhere, and another procedure with sdOnPowerOff to execute the code. <>However, see below... <> <>< I suppose I can patch the Shutdown trap and work my magic before any <>< Shutdown tasks are run, but the mere existence of the Shutdown Manager <>< makes me reluctant to reinvent the (possibly incompatible) wheel. So, <>< does anybody out there have any idea how my shutdown task can determine <>< what kind of shutdown/restart it was called during? <>< <>Patch Shutdown. I'm not intimately familiar with the Shutdown manager, but I have patched a few traps in my time. I offer the following suggestion: Patch Shutdown, but since you're worried about compatibility, just have that patch set a flag somewhere that your real shutdown routine can see it. Then proceed legally and cleanly to _Shutdown... Presumably, your sdUnmount (or sdPowerOff) routine will get called at the right time, look at the flag, and if it's been set, put up the dialog box. Does anyone see a problem with this? Or is it redundant? "So we stole a painting. So we turned a policeman into a toilet. Worse things happen every day in El Salvador." - Grant Morrison, Doom Patrol #29 -- Alex Chaffee chaffee@reed.UUCP Reed College, Portland OR 97202 ____________________