Path: utzoo!attcan!uunet!cbmvax!vu-vlsi!swatsun!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: Suspend Resume events.. how? Message-ID: <2874@carthage.cs.swarthmore.edu> Date: 12 May 89 14:20:55 GMT References: <5693@microsoft.UUCP> Reply-To: jackiw@carthage.UUCP (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 50 In article <5693@microsoft.UUCP> stuartb@microsoft.UUCP (Stuart Burden) writes: > Could someone kindly point me to some information (or give me a pointer or > two) on how to implement recognition on suspend/resume events. > In order to ever see them, you'll have to create a SIZE ID=-1 resource, and--in ResEdit--set the "Accept Suspend Events" and "Multifinder Aware" bits. Once you've done this, your program can assume initially (i. e. prior to your event loop) that you're switched _in_ (I've yet to find a way of launching apps in the background, unless they're background-only sort of things like PrintMonitor). Your event loop should watch for app4Evts, which MultiFinder will post to it. The event.message field tells whether you're going out or in, and whether your clipboard needs conversion (from some weird private format you implement to public TEXT or PICT scraps). Bit Meaning 0 0=Suspend; 1=Resume 1 0=Conversion not required; 1=Convert to public formats 2-n reserved And that's it. I think if you don't set MFAware, but DO set AcceptsSuspends, then your application will receive activate and deactivate events for its top window as its being switched in or out as well. I'm not sure. -Nick. > Any help would be appreciated. Thanks. > > Stu. > > __Paths to my door:_______________________ > microsoft!stuartb@beaver.cs.washington.edu - Usual disclaimer, that all > microsoft!stuartb@uw-beaver.arpa - the above is pure fantasy > microsoft!stuartb@uunet.UU.NET - and Microsoft only > [DE01HB]stuartb@DASNET# {from AppleLink} - gave me the Mountain Dew > stuartb@microsoft.uucp {well connected} - to dream it all in a > D2012 {@applelink.apple.com - shared acct} - caffeine haze :-) > __________________________________________________________________________ -- _ _|\____ Nick Jackiw | Visual Geometry Project | Math Department / /_/ O> \ ------------+-------------------------+ Swarthmore College | O> | 215-328-8225| jackiw@cs.swarthmore.edu| Swarthmore PA 19081 \_Guernica_/ ------------+-------------------------+ USA