68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Replicate Finder shutdown
Posted by: nil on 2024-09-30 06:25:15
Hi I'm trying to make my own Finder.
Implementing the apple events now.
I'm reading the inside macintosh docs on how the finder shuts the machine down.

  1. Checking for and executing custom shutdown procedures installed by calls to ShutDwnInstall. (This step occurs three times during the shutdown process.)
  2. Checking the Device Manager’s unit table to determine whether any drivers or desk accessories are open and, if so, notifying them of the impending shutdown or restart.
  3. Saving the desk scrap, if any.
  4. Unmounting mounted volumes.
  5. Turning off the computer.
In my Finder I have implemented, 1. QuitAllApplications, 5. UnmountAllVolumes and 6. PowerOff.
Am I doing it right? Thanks
Posted by: cheesestraws on 2024-09-30 07:48:29
I think you're going to have to give us more details, but it looks like you're missing 1 and 2 here - also, what system software version(s) are you aiming for?
Posted by: nil on 2024-09-30 08:20:47
i'm developing in realbasic 5.5.5 which targets powerpc macOS 8/9. eventually i'll backport to 68k, so I'm trying to avoid carbon lib, etc.

from what i can tell, the shutdown manager does all the steps except for sending the quit appleevent to open apps and it won't call the ShutDwnPower or ShutDwnStart function unless all apps have quit and all volumes have unmounted.
Posted by: cheesestraws on 2024-09-30 08:23:50
Yeah, and under 7+ I'm fairly sure you can get away with pretending Desk Accessories are just applications. So if you just do the 'quit all applications politely by apple event or fake quit click' and then call the shutdown manager you're probably OK.
1