[comp.sys.mac.programmer] Resources, drivers and applications

resnick@lees.cogsci.uiuc.edu (Pete Resnick) (07/13/90)

The answer to these questions may be simple.....or I may be in trouble.

I am writing an init that is really a just a DRVR that I open at init
time and set the NeedTime and NeedLock flags. So my init will basically
do an OpenDriver call (locking all my data up, etc.) and that will be
the end of it. My driver will also be able to be closed or opened from
the Control Panel. Certain parameters will be set in the Control Panel
and saved in a prep file. There will also be some data that will be
stored in the DRVR/cdev/INIT resource file itself. Now the fun part:

My driver needs to do two important things:

1. I'm going to need to OpenRFPerm the file that the driver is in.
Will CurResFile give me my own resource refNum when I open at init
time as well as if I do the open in the Control Panel? If not, how
do I do it?

2. I want to figure out what the current application is when my
driver gets its accRun calls from the system. Will GetAppParms, or
even CurApName, give me this information when my driver gets called
by the system? Is there any other way to get this if not?

3. I would like to keep track of idle time (i.e. how long it's been
since the last keystroke, mouseclick or disk insertion). Can I do
this from inside my driver? I can't figure out a way to do this using
the Toolbox Event Manager, but maybe I'm just missing something.

Now weren't those easy questions. :-)

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@kant.cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD