[comp.sys.mac.programmer] Finding out What Application is Run

leonardr@uxe.cso.uiuc.edu (12/29/88)

jdm@ut-emx.UUCP(Jim Meiss) writes in comp.sys.mac.programmer

>	In my desk accessory, I need to tell whether I've been opened
>under Excel, because Excel always keeps its edit window as the
>frontmost window.
>	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!).
>	Anyway, does anyone have a better idea? I always get nervous
>using a low memory global!
>
	I believe that what you REALLY want to do is not to use the CurApName but
instead us the CurApRefNum which will give you the refNum for the file. Tehn
use the refNum to get the file creator and match that to Excel's (since 
the chances of it being changed are slim to nil!)


+---------------------------------+-----------------------------------+
+                                 +  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                 +
+                                 +                                   +
+---------------------------------+-----------------------------------+