Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!rutgers!att!pegasus!ech From: ech@pegasus.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Multifinder problem Message-ID: <2530@pegasus.ATT.COM> Date: 19 Jan 89 18:22:28 GMT References: <1322@viscous.sco.COM> Organization: AT&T ISL Middletown NJ USA Lines: 41 In <2314@ilium.cs.swarthmore.edu> jackiw@ilium.UUCP (Nick Jackiw) writes: !When User shutsdown or restarts from the Finder, MultiFinder attempts to !QUIT your opened app by looking in the FILE menu for a "QUIT" item. Likewise, !when User double-clicks a doc tied to your app when your app is running, it !feeds your application as Mousedown in the MENU bar, and then forces !_MenuSelect to return the item# of your "OPEN" command. This usually is The latter is not quite right: it jams an Open, then intercepts the call to SFGetFile and feeds back the selected file in the SFReply. In <1322@viscous.sco.COM> jamesm@sco.COM (James M. Moore) writes: ! How does it tell which is which? I hope it doesn't do something ! foolish like look for the strings "Quit" and "Open," as not all ! software is written in English. (If it does do something this ! braindead, could someone plese tell me how to modify this string from my ! code?) It does something precisely that "braindead." Makes sense to me, they wanted as many existing applications as possible to inherit this nifty feature. However, they did not do anything as "braindead" as to expect YOU to hack up THEIR system, or somebody else's apps. Instead, they provided a mechanism to override: extracted from TN 205 (8/88, rev'd 12/88): mstr 100 (mst# 100): name(s) of the menu containing the quit command mstr 101 (mst# 101): name(s) of the menu item for the quit command mstr 102 (mst# 102): name(s) of the menu containing the open command mstr 103 (mst# 103): name(s) of the menu item for the open command with a caveat that you shouldn't get too clever. See the full TechNote for details. mstr (mst#) resources are structured identically to STR (STR#) resources, use "Open as..." from ResEdit. BTW, I've successfully added mstr's to existing applications, with sanguine results. The drawback in many cases is that lots of applications disable 'Open' when there's an open document; a friendlier programming technique is to either support multiple documents, or do an implicit Close first when Open is selected. =Ned Horvath=