Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Shutdown sequence question Message-ID: <9242@hoptoad.uucp> Date: 10 Dec 89 07:42:03 GMT References: <1989Dec7.083540.3798@agate.berkeley.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 38 In article <1989Dec7.083540.3798@agate.berkeley.edu> rgm@OCF.Berkeley.EDU (Robert Menke) writes: >This is beginning to bother me. How does the Finder (under >MultiFinder) send messages to each of the open applications to close >when the user selects "Shut Down" from the "Special" menu? By magic. It goes through the MultiFinder list of applications, searches each one for a quit command in the file menu, posts a fake mouse-down event in the menu bar, and patches MenuSelect to return the number of the required menu item. It then waits for the application quit, including any necessary save dialogs. You can't do this and it would be unwise to try. >Obviously it is not a patch to the _Shutdown macro (or is it? I'm not >sure how patches are handled under MultiFinder) nor does it seem to be >procedures installed via ShutDwnInstall (or do procedures installed >only execute if the application containing them is the active one? >That would seem silly). Nope, the Shutdown Manager is not involved. If you call Shutdown from your own program, it's tough cookies for any other applications that may be running at the time. The Finder does it strictly in response to receiving the Restart and Shut Down menu commands. Hopefully, the Shutdown manager will do this in System 7.0, but I wouldn't hold my breath. (Since you'll be able to give a Finder menu command from other applications then anyway, it's not really mandatory.) >This is bothersome to me because I use MPW 2.0.2 as a CLI more often >than I use the finder, and it's irritating to have to flip out to the >finder to quit (even MPW's "shutdown" command fails to notify >applications). Yep. It's a pain. No good way around it, though. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "There are no Famous People on the net. Only some of us with bigger mouths than others." -- Dan'l Danehy-Oakes, The Roach