home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!kimbark!ejw1
- From: ejw1@kimbark.uchicago.edu (Eric Weidl)
- Subject: Re: Easiest way to find my PSN (Process Serial Number)
- Message-ID: <1992Sep15.144629.21586@midway.uchicago.edu>
- Sender: news@uchinews.uchicago.edu (News System)
- Reply-To: ejw1@midway.uchicago.edu
- Organization: Academic and Public Computing
- References: <1992Sep14.213345.14845@midway.uchicago.edu> <x-znmmf.gurgle@netcom.com>
- Date: Tue, 15 Sep 1992 14:46:29 GMT
- Lines: 49
-
- In article <x-znmmf.gurgle@netcom.com> gurgle@netcom.com (Pete Gontier) writes:
- >ejw1@kimbark.uchicago.edu (Eric Weidl) writes:
- >
- >> Is there any easy way to determine my own Process Serial Number?
- >
- >GetCurrentProcess. There are also constants which you can stuff
- >into a PSN, but I can never remember their names, so I just call
- >the trap. :-)
-
- Of course! If I call GetCurrentProcess right after I am launched, A5 will be
- mine and I'll get my own PSN. I had been thinking about GetCurrentProcess,
- but figured that I'd call it when I needed it, ie. when I was in the
- background. At that time, it would return a PSN, but not mine. If I call it
- before entering my event loop, I'll be in the foreground and it should work.
-
-
- >> The reason I want to know my PSN is so that I can call
- >>SetFrontProcess() to bring myself to the foreground in response to an
- >>AppleEvent. I've tried every combination of parameters in AESend() and
- >>AEInteractWithUser(), but to no avail. So, I thought I'd try
- >>SetFrontProcess.
- >
- >This will certainly work, and I'm no expert on AE, but I believe the
- >idea is to let the sender of the event decide whether your app should
- >come to the front. Perhaps forcing your app to the front is not a
- >desirable effect.
-
- We are working on a gopher client which uses a number of different apps to
- view different file types. The different apps communicate via AppleEvents.
- Since the applications act as a suite, and I know who is asking me to open
- a document and why, I'm taking liberties with interaction levels, etc.
-
- I looked at the Sender and Reciever examples apps on the Developer's CD and
- determined that the correct set of parameters to bring an app to the
- foreground was: Reciever app, kAEInteractWithAll (or kAEInteractWithLocal),
- and then call AEInteractWithUser(); Sender app, kAECanInteract (or
- kAEAlwaysInteract), kAEWaitReply, and kAECanSwitchLayer. With this
- conbination of bits, the Reciever app comes to the foreground when it recieves
- the AppleEvent, but my app doesn't.
-
- >--
- > Pete Gontier // EC Technology // gurgle@netcom.com
-
- Eric
- --
- ===================================================================
- Eric Weidl e-weidl@uchicago.edu
- University of Chicago -- Academic and Public Computing
- ===================================================================
-