home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15151 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.1 KB  |  46 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!wupost!csus.edu!netcom.com!leonardr
  3. From: leonardr@netcom.com (Leonard Rosenthol)
  4. Subject: Re: Patching the _Launch Trap
  5. Message-ID: <gvrn-n#.leonardr@netcom.com>
  6. Date: Tue, 08 Sep 92 17:09:43 GMT
  7. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  8. References: <1992Sep8.024049.20121@Arco.COM> <1992Sep8.145100.26889@Arco.COM>
  9. Lines: 35
  10.  
  11. In article <1992Sep8.145100.26889@Arco.COM> John Champion <dedjhc@arco.com> writes:
  12. >In article <abrn6k+.leonardr@netcom.com> Leonard Rosenthol,
  13. >leonardr@netcom.com writes:
  14. >>
  15. >>    If you could post what you are trying to accomplish by patching _Launch
  16. >>someone could probably suggest an alternate approach that would be
  17. >successful.
  18. >
  19. >I need FSSpec type information on applications and associated documents
  20. >that are launched, particularly by the finder.  Unfortunately, not all
  21. >applications accept apple events so I can't just check for those.
  22. >
  23.     Well, finding applications are easy, but getting documents may be a
  24. bit difficult since they are not "launched".  
  25.  
  26.     One way that might work, assuming that you only care about System 7
  27. would be to intercept 'osel' events in the Finder.  When the Finder "opens"
  28. anything, file, folder, disk, etc. it will send itself an 'osel' event - also
  29. many launching utils will also send the same event to the Finder in order to 
  30. have things opened.
  31.  
  32.     There are two ways to intercept Apple events.  The hard way is to patch
  33. _Pack8 (Apple Event manager), the easy (but undocumented way) is to install
  34. something called a PHAQHandler.  A PHAQHandler is the equivalent of a head
  35. patch on an Apple event handler, so you could just grab the data for the event
  36. and then pass it along.  You might also be able to do the same thing by 
  37. getting the address of the current 'osel' handler, installing your own and
  38. then calling the original...
  39.  
  40. -- 
  41. -----------------------------------------------------------------------------
  42. Leonard Rosenthol            Internet:     leonardr@netcom.com
  43. Director of Advanced Technology        AppleLink:    MACgician
  44. Aladdin Systems, Inc.            GEnie:        MACgician
  45.  
  46.