Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!agate!shelby!decwrl!nsc!taux01!cyosta From: cyosta@taux01.UUCP ( Yossie Silverman) Newsgroups: comp.sys.mac.programmer Subject: Re: Tail patches Message-ID: <2839@taux01.UUCP> Date: 11 Nov 89 09:05:50 GMT References: <1459@sequent.cs.qmc.ac.uk> <36250@apple.Apple.COM> <5056@internal.Apple.COM> <1989Nov7.212837.5146@oracle.com> <5080@internal.Apple.COM> <1467@sequent.cs.qmc.ac.uk> Reply-To: cyosta@taux01.UUCP ( Yossie Silverman ) Organization: National Semiconductor (IC) Ltd, Israel Lines: 43 In article <1467@sequent.cs.qmc.ac.uk> jeremyr@cs.qmc.ac.uk (Jeremy Roussak) writes: .>As for "sometimes you just gotta," all I can say is: don't do whatever it .>is you're doing that's "just gotta." Find a "more inventive" way. . .Since I initiated this thread, perhaps I could explain what I was doing, .and ask if anyone can suggest an alternative way of doing it. . .I was challenged to write a patch which would play a sound, preferably .whenever the Finder emptied the wastebasket (doesn't appear to be possible) .or at least when "Empty Wastebasket" was chosen from the menu. The .reason for this curious request was that the person concerned had changed .the wastebasket icon to look like a toilet and wanted it to flush! . .The obvious thing to do, (and we all do obvious things, don't we...) .was to do a tail patch on MenuSelect, look for a return of 0x00050002, .check that CurApName is the same as FinderName and to play the sound .if it is. I did it. It worked. It's not subtle, or particularly .clever, I confess. . .How should I have done this, without using a tail patch? . .Jeremy Roussak I have a neat idea, check for a transition from the 'empty trash' icon to the 'full trash' icon, and back. In you case you can produce an obscene noise (toilet seat going slam) when trash fills, and a flush sound when it empties. This would be done by patching copybits and doing some compares on the bitmap's when the appname = finder. Whatcha think? It would only fail if some other application had the same icon and it was being displayed in a finder window. It would fail when someone changed the 'trash can' icons on you. This seems to be a legal patch, after all ColorFinder is doing it as well as ColorQD32 (and who knows who else). In fact, the same mechanism could probably be used for other interesting effects! You could make noises whenever an icon of your choice appeared on the screen. Of course this would fail if ColorFinder was replacing the B/W icon (which you recognize) with a color one (which you don't). Ah well, enough talk. Go for it! - Yossie -- Yossie Silverman What did the Caspian sea? National Semiconductor Ltd. (Israel) cyosta%taux01@nsc.nsc.COM or RPR1YOS@TECHNION.BITNET NSA LSD FBI KGB PCP CIA MOSAD NUCLEAR MI5 SPY ASSASSINATE SDI -- OOLCAY ITAY