Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!leonardr From: leonardr@uxe.cso.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: INITs and ShutDown routines Message-ID: <226000040@uxe.cso.uiuc.edu> Date: 1 Jan 89 04:24:00 GMT References: <144@radar.UUCP> Lines: 46 Nf-ID: #R:radar.UUCP:144:uxe.cso.uiuc.edu:226000040:000:1721 Nf-From: uxe.cso.uiuc.edu!leonardr Dec 31 22:24:00 1988 Since I had a couple of requests for example source, here is the source for my ShutDownSoundINIT loader. The code is simple enough that comments are not included (like they should be :-) {This is the loader procedure for ShutDownSoundINIT} {It has hereby been put into the public domain by Leonard Rosenthol} PROCEDURE Main; VAR savedZone : THz; theSize : integer; tempPtr : ptr; theHandle : handle; BEGIN theHandle := GetResource('PROC', 128); HLock(theHandle); theSize := SizeResource(theHandle); savedZone := GetZone; SetZone(SystemZone); tempPtr := NewPtr(theSize); IF tempPtr <> NIL THEN {It worked, let's do it!} BEGIN BlockMove(theHandle^, tempPtr, theSize); ShutDwnInstall(ProcPtr(tempPtr), 8); ShowInit(128, -1); {This will show the ICON for us on startup} END ELSE SysBeep(10); SetZone(savedZone); END; END. P.S. I wrote this code over a year ago, and if I were to do it today I might change a few things. it does however work! +---------------------------------+-----------------------------------+ + + Any thing I say may be taken as + + Leonard Rosenthol + fact, then again you might decide+ + President, LazerWare, inc. + that it really isn't, so you + + + never know, do you?? + + leonardr@uxe.cso.uiuc.edu + + + GEnie: MACgician + MacNET: MACgician + + Delphi: MACgician + AppleLink: D0025 + + + + +---------------------------------+-----------------------------------+