Info-Mac Archive Downloads: dev/src/ SourceCode

Back to dev/src/ SourceCode

Detect New Volume - Display volume's message-of-the-day (detect-new-volume-cpp.hqx)

Download detect-new-volume-cpp.hqx (84,136 KB)


From: oleg@ponder.csci.unt.edu (Kiselyov Oleg)
Subject: Detect New Volume - Display volume's message-of-the-day
Date: Thu, 17 Mar 1994 14:32:46 -0600



--========================_13948252==_
Content-Type: text/plain; charset="us-ascii"

What: Detect a new mounted volume and "double-click" at a
document/application (if found) at a "standard" location on that volume
What for: telling the user (a student) what's new on some particular
volume and/or how to use it. The document "clicked" by the
present WatchVol program may be a text document about what's new
on the volume. Or it may be any application that somehow prepares
the student how to use the (file server) volume, whenever the
volume is mounted.
Hot points: Dynamic (transient) patch of the system: doesn't require
restarting the system, gets uninstalled when the application quits.
Contents:
WatchVol - Application (watchdog) itself
Watch MountVol.pi - project and resource files to build it
Watch MountVol.pi.rsrc
WatchMount.cc - Source code of the main module (C++)
launcher.cc - Launches an application-creator given FSSpec of
the document/application
MountVol init.pi - project to compile an Init (not INIT!) code
resource that patches the system on-the-fly
MountVol init.c - Source code of the _MountVol interceptor
(assembly inlined into a dummy C program)
The source code contains enough (I hope) comments to show what
a particular piece of code does, as well as some tricks involved
Language: Symantec C/C++ 6.0 and built-in Assembler
System: System 7.x, uses AppleEvents. Tested on IIsi, IIci,
Quadras and Centres.
Patching the system: _MountVol system trap is patched when the application
starts up. The patch is removed (i.e., the trap is restored to
its original state) when the application quits.
How to run: place the application into your "Startup Items" folder;
the application quits when it receives a "QUIT" event, or
when it's in the foreground and any keyboard key is pressed.
Note: the source code uses a "standard" environment, see myenv-notify.cpt
For completeness, the library and the .h file are included as a separate
CompactPro archive. However, they (complete with the source code)
can be found at various archive sites under the name 'myenv-notify'
Comments to: oleg@ponder.csci.unt.edu, oleg@unt.edu



--========================_13948252==_
Content-Type: application/mac-binhex40; name="DetectNewVolume.cpt"
Content-Disposition: attachment; filename="DetectNewVolume.cpt"