Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!caen!mondo.engin.umich.edu!mystone From: mystone@mondo.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Re: Sublaunching ??? Message-ID: <1990Dec12.193848.14629@engin.umich.edu> Date: 12 Dec 90 19:38:48 GMT References: <1990Dec11.004705.20759@dhw68k.cts.com> <1990Dec12.155057.5967@eng.umd.edu> Sender: news@engin.umich.edu (CAEN Netnews) Reply-To: mystone@mondo.engin.umich.edu Organization: Patches 'R' Us, A Wholly Owned Subsidiary of Cyberite Systems Lines: 47 In article <1990Dec12.155057.5967@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes: >In article <1990Dec11.004705.20759@dhw68k.cts.com> finnegan@dhw68k.cts.com (Greg Finnegan) writes: >> >>We just added sublaunching to our application and everything works >>fine so far. However, if you sublaunch to another application (with >>a document that you want to open) and that application is already >>running under MultiFinder, the application just comes to the front. >>Apparently, MultiFinder does some low level mucking to allow >>sublaunching to open apps with a document. >> >>Anybody have any ideas how I might do the same? >> >>Greg. > >Yes, but not many (I've tried). The OSDispatch trap is what does it, I >believe--- if you can figure out its format, you can do it. I was going to suggest that you fill the AppParmHandle low memory global with the information needed for the application to open the documents, but then I realised that you wanted to open those documents from an application that was already running. This is how I understand MultiFinder makes applications open documents; whether you can use this info or not is questionable, but it's interesting nevertheless. When you double-click on a document in the Finder and the application which created that document is already running, MultiFinder switches it into the foreground. MultiFinder then searches your menus for an Open item in the File menu. If you don't have an Open in the standard place, MultiFinder looks for 'mstr' and 'mst#' resources in the application to tell it where the Open item is. Once it finds that item, it calculates where on the screen that item would be if the menu were pulled down. It posts a mouseDown event in the menu bar over the menu title, and a mouseUp event over the menu item. A patch on _MenuSelect is installed so you don't see the menu pop down briefly. A patch is also installed on _Pack3 (Standard File). This patch doesn't bring up the Standard File dialog, but simply returns an SFReply record containing information for the document you double clicked on in the Finder. That's all there is to it! _______________________________________________________________________________ Dean Yu | E-mail: mystone@mondo.engin.umich.edu Patches 'R' Us | Real-mail: Dean Yu A Division of Cyberite Systems | 909 Church St Apt C | Ann Arbor, MI 48104 I'm not the voice of Reason, much | Phone: 313 662-4073 less the voice of Cyberite. | 313 662-4163 -------------------------------------------------------------------------------