hamachi@UCBKIM (Gordon Hamachi) (09/04/85)
A number of programs provide the ability to invoke another program. Others such as the "transfer" desk accessory, the finder, and the minifinder, regain control once another program terminates. Can someone explain how to this mechanism works? It occurs to me that it might not be too hard to get a public domain "make" program to run on the Mac. --Gordon Hamachi
vishniac@wanginst.UUCP (Ephraim Vishniac) (09/05/85)
> A number of programs provide the ability to invoke another program. Others > such as the "transfer" desk accessory, the finder, and the minifinder, regain > control once another program terminates. > > Can someone explain how to this mechanism works? It occurs to me that it > might not be too hard to get a public domain "make" program to run on the > Mac. > I know of two ways that one can gain control between application programs. If you mean to completely replace the finder, you install your program by setting it as the "shell" application. This is one of the items stored at the front of the boot sectors on your disk. After IPL, the name of the shell is stored in low memory, so you can change shells on the fly. The sneakier method is to use _GetTrapAddress and _SetTrapAddress to insert some of your own code into the _Launch and _ExitToShell traps. For example, you could patch yourself into the _ExitToShell trap to give the user the choice of launching another program or continuing into the real finder. Although I haven't checked to be sure, I imagine that this is the way the SkipFinder DA operates. -- Ephraim Vishniac [apollo, bbncca, cadmus, decvax, harvard, linus, masscomp]!wanginst!vishniac vishniac%Wang-Inst@Csnet-Relay