Path: utzoo!attcan!uunet!lll-winken!ames!pacbell!well!brecher From: brecher@well.UUCP (Steve Brecher) Newsgroups: comp.sys.mac.programmer Subject: Re: Open Resource File List Message-ID: <10393@well.UUCP> Date: 17 Jan 89 21:20:39 GMT References: <67009@ti-csl.CSNET> <2580007@hpausla.HP.COM> Reply-To: brecher@well.UUCP (Steve Brecher) Organization: Software Supply, Sunnyvale, CA Lines: 21 In article <2580007@hpausla.HP.COM>, jcl@hpausla.HP.COM (Jeff Laing) writes: > I want to be able to do the 'reverse' of Get1Resource(); that is, I want to > be able to access a particular resource, which is NOT in the current resource > file. Does anyone know how I can take the current application (and all > resource files after it in the list) out of the resource search? The refNum of a resource file is stored at an offset of 20 decimal from the start of the file's resource map in RAM; a handle to the map of the most recently opened resource file is stored in system global variable TopMapHndl at 0xA50. Calling UseResFile on the most recent file's refnum will include all open files in the search performed by a subsequent GetResource. HomeResFile(rsrcHandle) will return the resource's file's refnum; comparison with your application's refnum can be used to determine whether the resource came from your application file. If you must follow the chain yourself, note that offset 16 decimal from the start of a resource map contains a handle to the next map in the chain or nil for the last map in the chain. -- brecher@well.UUCP (Steve Brecher)