Path: utzoo!attcan!uunet!husc6!rutgers!ucsd!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding out What Application is Running Keywords: Desk Accessories, CurApName Message-ID: <27264@ucbvax.BERKELEY.EDU> Date: 28 Dec 88 16:25:35 GMT References: <9065@ut-emx.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 20 In article <9065@ut-emx.UUCP> jdm@ut-emx.UUCP (Jim Meiss) writes: > Currently I just check CurApName to see if it includes the >string "Excel". Of course that only works if someone hasn't renamed >Excel to something else (perverse person!). Get the application's resource fork's refNum. Stack the current refNum UseResFile(appsRefNum); Get1Resource('BNDL',...) (remember, 64kROM macs don't have this call, so you'll need to do a GetResource and a HomeResFile to simulate it.) near the beginning of the BNDL is the application's signature. This is supposed to be unique for each application (that has an icon anyway) So, it is a reliable way of seeing which application your are in. Use the call GetAppParams() to get the application's refnum. It is documented in the Segment Loader section of Inside Mac. --- David Phillip Oster --"When we replace the mouse with a pen, Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee