Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!julius.cs.uiuc.edu!news.cs.indiana.edu!bronze!bronze.ucs.indiana.edu!cmcclary From: cmcclary@bronze.ucs.indiana.edu (Charles McClary) Newsgroups: comp.sys.mac.programmer Subject: Problem with GetNextEvent trap patch in MultiFinder Message-ID: <1991Jan15.200340.28431@bronze.ucs.indiana.edu> Date: 15 Jan 91 20:03:40 GMT Sender: news@bronze.ucs.indiana.edu (USENET News System) Organization: Indiana Univeristy Lines: 72 I am trying to patch the GetNextEvent trap A970. My test patch seems to work correctly in Finder, but not in MultiFinder. In MultiFinder, when a desktop icon (disk icon) is covered up by a volume or folder window and the window is then moved to uncover the icon, the portion of the desktop icon which was covered remains invisible. This does not happen in finder. Below is the source code for the patch. I am using Think C 4.0. What an I leaving out? Thanks in advance, Charles McClary Indiana University cmcclary@bronze.ucs.indiana.edu /************* Patch to GetNextEvent **********/ #include #definenil0L #defineGetNextEventTrap0xA970 longoldGetNextEvent; Str255trash; pascal Boolean NewGetNextEvent(int eventMask, EventRecord *theEvent); void main(void); pascal Boolean NewGetNextEvent(eventMask, theEvent) inteventMask; EventRecord* theEvent; { SetUpA4(); CallPascalB(eventMask, theEvent, oldGetNextEvent); RestoreA4(); } void main() { HandlemyHandle = nil; PtrmyPtr; SysEnvRecworld; Str255*namePtr; asm { move.l A0, myPtr } RememberA0(); SetUpA4(); if (!Button()) { myHandle = RecoverHandle(myPtr); DetachResource(myHandle); oldGetNextEvent = NGetTrapAddress(GetNextEventTrap, ToolTrap); NSetTrapAddress(NewGetNextEvent, GetNextEventTrap, ToolTrap); } RestoreA4(); } Charles McClary Workstations Division University Computing Services Indiana University cmcclary@bronze.ucs.indiana.edu