Xref: utzoo comp.sys.mac.system:6946 comp.sys.mac.programmer:25554 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!claris!UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.system,comp.sys.mac.programmer Subject: Re: Bringing Finder frontmost after Startup Items run Message-ID: <0B01FFFB.hfj14n@outpost.UUCP> Date: 5 Jun 91 22:36:47 GMT Reply-To: peirce@outpost.UUCP (Michael Peirce) Organization: Peirce Software Lines: 94 X-Mailer: uAccess - Mac Release: 1.1.b3 In article <18154@venera.isi.edu>, jas@ISI.EDU (Jeff Sullivan) writes: > In article <1991Jun4.155851.23146@mmm.serc.3m.com> pejacoby@mmm.serc.3m.com (Paul E. Jacoby) writes: > > >In article <0B01FFFB.gwbpcl@outpost.UUCP> peirce@outpost.UUCP (Michael Peirce) writes: > >> > >>In article <1991May30.142809.10293@umiami.ir.miami.edu>, dweisman@umiami.ir.miami.edu (Ordinary Man) writes: > >>> There's a real cheap way to get the finder to the front without any > >>> inits or other apps running. Just put an alias to your hard drive in the > >> > >>Sounds like a better way than a special app. So maybe I won't post > >>my little hack (harumph, my first System 7 specific App is worthless :-) > >>-- michael > > Right. > > >And Michael, why don't you release your hack anyway? We can ALWAYS use > >more neato utilities for 7.0! > >-- > > Why in hell would you want to promote the spread of hacks into the > system when you can already do what the hack does? Just spreads > possible incompatibilities. Who's talking about spreading possible incompatibilies to the system? The process manager is fully documented in Inside Macintosh Volume VI. Everything you need to know to write this "hack" is there. No trap patching or other "bad things". I was using the term HACK to mean a quick and elegant little program that gets the job done. This is the good connotation of this word, not the bad. Sort of like describing myself as a hacker. I don't mean I break into systems and steal national security secrets, but rather I enjoy playing around with the system and exploring its secrets - helping me do a better job for my clients and myself. -- michael P.S. Here's the WHOLE program that does this, simply compile in into an Application (or an MPW tool, that works too for easy testing). It works as is, but it doesn't have any UI and this might confuse people who run across it not knowing what it's for. If someone wants to run with this, please give some sort of UI. Thanks. PROGRAM FinderFirst; USES Processes; FUNCTION GetFinderSerial : ProcessSerialNumber; VAR process : ProcessSerialNumber; infoRec : ProcessInfoRec; BEGIN {GetFinderSerial} WITH process DO BEGIN highLongOfPSN := 0; lowLongOfPSN := kNoProcess; END; WITH infoRec DO BEGIN processInfoLength := SIZEOF(ProcessInfoRec); processName := NIL; processAppSpec := NIL; END; WHILE (GetNextProcess(process) = noErr) DO BEGIN IF GetProcessInformation(process,infoRec) = noErr THEN BEGIN IF (infoRec.processType = LONGINT('FNDR')) AND (infoRec.processSignature = 'MACS') THEN BEGIN GetFinderSerial := process; Exit(GetFinderSerial); END; END; END; END; {GetFinderSerial} BEGIN {MAIN} IF SetFrontProcess(GetFinderSerial) <> noErr THEN BEGIN SysBeep(5); END; END. {MAIN} -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE