[comp.sys.mac.programmer] MultiFinder help needed

summer@rhea.trl.oz.au (Mark Summerfield - Switching) (01/09/90)

I am trying to make an application MultiFinder aware, and have a couple
of questions which are unanswered by any technical note I can lay my
hands on.

The first has probably been discussed long ago- I'm sorry, but I'm
rather new at this. I understand about the SIZE-1 resource, and how to
use WaitNextEvent instead of SystemTask, and GetNextEvent, and I believe
that MultiFinder uses app4Evt's to return the resume and suspend events
to the application. What I need to know is how does it return which sort
of event it is (resume, suspend etc)? And are the constants defined in
any of the MPW Pascal 3.0 interface files? (I can't find them) If not,
what are they? Also, what does the sleep parameter of WaitNextEvent
define exactly? Is it the number of ticks until control is passed back
to the foreground application (assuming no other important event
intervenes)?

The next question is perhaps a little more interesting. The application
in question is for display purposes, and it is desired to disable the
Quit option once it is set up (so that prying hands can't do any harm).
I had assumed that this would not cause problems, since Shut Down would
force the application to be closed. Apparently, however, MultiFinder
attempts to issue a Quit command to the application when you Shut Down,
and so fails, since it is not enabled (aarrgghh!!) Can anybody think of
a way to solve this problem? Once I've got suspend/resume event handling
working, will I be able to re-enable Quit whilst in the background to
get round this? I am afraid that what will happen if I try this is that
on Shut Down I'll get a resume event, upon which I'll disable Quit,
FOLLOWED by the quit command, which I will consequently ignore.

Thanks in advance.

--
Mark Summerfield
Telecom Research Laboratories (Australia)
----------------------------------------------------------------------