ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
LaunchApplication and canBackground bitDate Written: 3/26/93 Last reviewed: 6/24/93 When I use
You can verify this by using an application that lists current processes, to see whether the application is indeed listed as running, but it will never get time unless it's manually brought forward by the user. We've entered this as a bug in our database. Hopefully we'll be able to address it in the future. Process Manager and ResErrProcDate Written: 3/30/93 Last reviewed: 7/2/93 I've installed a resource error procedure ( If you install a What has happened is that the Process Manager has patched
Similar problems can occur if you make calls that make other Resource Manager
calls. The secondary calls may produce errors that are inconsequential to the
primary call, but your How to keep Process Manager from closing files when app quitsDate Written: 8/24/92 Last reviewed: 6/14/93 Somehow System 7 keeps track of which application opened a file, so that it can close files left open if the application crashes. Well, I need to defeat this mechanism to keep the Macintosh Operating System from closing a file after a user quits our application. How do I do that? The Process Manager keeps track of the files opened by an application. Since applications are normally supposed to close the files they open, but many don't, Apple decided to let the Process Manager do the job for those that don't do it themselves. You aren't the first to complain about this behavior since there are several valid cases for leaving a file open. Anyway, there are two ways to work around this. If this first method will work for you, you should use it since it doesn't involve patching anything. Let your application launch a small faceless background application (FBA) whose purpose is to open files for you. Communicate with the FBA through Apple events to:
Use An FBA is the recommended method. The other method is to patch A couple of examples that might help you with the FBA can be found on the
Developer CD. They're called How to tell if Macintosh Process Manager is presentDate Written: 1/21/91 Last reviewed: 6/14/93 What is the proper way to tell if the Process Manager is present? The System 7 Process Manager is available if a Code snippet to check for high-level event support in a processDate Written: 11/12/90 Last reviewed: 6/14/93 How can I find out if a specific process is running on my system and if it supports high-level System 7 events? You can check to see if a specific process supports high-level events with code similar to this:
Launching a Macintosh applicationDate Written: 4/30/91 Last reviewed: 6/14/93 Under MultiFinder or Macintosh System 7, is there a way to set a flag to
terminate the current application before launching a different application?
Under standard Finder, the launcher quits before the launchee starts. However,
under MultiFinder or System 7, they both must stay in memory for a brief time
until control returns to the launcher and it hits the Two distinct cases are involved here: the System 7.0 case and the pre-System 7.0 case. In System 7.0 there is a new way to launch applications. The function is called
(appropriately enough) You can determine whether your system software has the new Launch Control
capabilities by using
The above code assumes that you are developing with interfaces and libraries
based on MPW 3.2, as those interfaces and libraries support The portion of the Process Management chapter of Inside Macintosh Volume
VI that will interest you is the description of the "When you use the
Set the launchContinue flag if you want your application to continue after the
specified application is launched. If you do not set this flag,
In other words, you have to request that your launching application continue if
you use This leaves the pre-System 7.0 case. System 4.1 and later versions allow for the use of an extended Launch parameter block also, but it is somewhat different from that of System 7.0. The complete details can be found in the Macintosh Technical Note "Sub(Launching) From a High-Level Language." You'll need to use the extended version of the parameter block and specify a launch rather than a sublaunch. Unfortunately, the launching application does in fact not quit until the launchee has come up. It sounds like you will have to launch a tiny utility application that then turns around and launches your real target. A good example of how all of this works in the System 7.0 case can be found in the
ProcDoggie 1.0a6 sample code, which is
in the Sample Code folder on the System 7.0 February 1991 beta CD-ROM. Among other things,
it demonstrates how to launch, and how to handle or send the required AppleEvents ( Changing the 'SIZE' -1 resource multilaunch bit at run timeDate Written: 1/6/92 Last reviewed: 6/14/93 Can an application change its own You may certainly modify the If you change your multilaunch bit, the application will need to quit before you can multilaunch it. When a single launch app is launched, it is opened with read/write exclusive privileges instead of multiuser privileges. So, no one else will be able to open the file to see that it is multilaunch until after you have quit. But, once you restart your application, it will be multilaunchable from then on. System 7 and MultiFinder's "puppet strings"Date Written: 8/30/91 Last reviewed: 6/14/93 When my application is running, it relies on the MultiFinder's "puppet strings"(which choose
Open from the application's File menu and suppress the System 7 will not pull puppet strings for an application that makes use of the System 7 Standard File routines,
such as If you update an older application to take advantage of any System 7 features,
be sure to also add support for the Background applications and alertsDate Written: 5/4/90 Last reviewed: 6/14/93 My application, running in the background, detects an error condition and puts up an alert; but only part of the alert is visible (other windows cover most of it). When I switch back to my application, the full alert becomes visible but the "OK" is not highlighted and often the icon is not shown either. Is there something I can do to prevent this? Applications running in the background should not be putting up alerts. In addition to the problems and complications you have already noted, under System 7.0 the user has the ability to hide a background application's window set and your alert would not be seen at the time you expect it to. There is, however, a mechanism in place that your background application can and should use: the Notification Manager. Documented in Inside Macintosh Volume VI, this manager allows a background process to notify the user that there is an alert, message, or situation pending in the background that needs to be taken care of. The user can then bring your application forward and you can present your alert as the foreground application. Process Manager saves and restores the 68881/882 registersDate Written: 5/3/89 Last reviewed: 6/14/93 Does the Process Manager save and restore the 68881/882 registers and state when it switches between applications? Yes. As far as your application is concerned, it has the FPU to itself. The only time you need to worry about saving and restoring the FPU's state is when you are doing floating point operations at interrupt time, such as in a VBL or completion routine. Watch out for calls to the Sound Manager, since it will use floating-point operations internally. Downloadables
|
|