About the Source Code
Size: 9,990 Bytes
Time: Around 2 seconds at 28,800 bps
What: The SendToBack FKEY and documentation
SendToBack FKEY 1.0 via Apple's Info-Mac mirror
SendToBack FKEY 1.0 via Proaxis Communications, Inc. (my ISP)
SendToBack is a freeware FKEY that sends the front window behind all others. This can very handy for flipping through windows, or just to get the front window quickly out of the way without closing it. Surprisingly enough, 90% of the programs out there that don't implement any sort of "send to back" function, despite the simplicity of such a function. Thus, SendToBack was born. Actually I've found that SendToBack does its stuff faster than the built-in send to back functions in some programs.
One problem that I've noticed: Some programs (namely Cyberdog) do not react properly when SendToBack moves their windows. That is, the windows change position fine, but the program doesn't realize that the window has moved, and doesn't adjust itself for the new window. In Cyberdog the solution to this is usually to click on the new front window after using SendToBack, or use Cyberdog's built-in send to back command. Most programs shouldn't care how their windows are ordered, and Cyberdog is the only one that I've noticed this with.
Also, if you find that SendToBack isn't working on some windows, you're right. SendToBack will only cycle non-dialog, standard system windows. This means that it will not work with programs who use custom windows. Programs that change the system's standard windows (like Kaleidoscope or Aaron) should work fine, however.
An FKEY is a minuscule program that lives in the System file (or Fonts folder). The FKEY's sole purpose in life is to wait for a Command-Shift-Number on the keyboard. Every macintosh has two built-in FKEYs: Command-Shift-3 (screen snapshot; you can also use Command-Shift-4 for a partial screen shot under Mac OS 7.6) and Command-Shift-1 (eject a floppy disk). Theoretically there is a Command-Shift-2 which would eject the second disk drive, but since all modern macs come with but a single drive, it's days are basically over. (I think it should be changed to "eject CD-ROM drive", but that's left as an exercise to the reader.) FKEYs are extremely handy-they can be invoked from (nearly) every program in existence without any extra work, and they have no interface and thus are very simple to write. But, FKEYs also have a few dastardly things against them: There can be only 10 of them active at any time (minus the 2 or 3 standard system FKEYs). There is no standard or easy way to install an FKEY. Also, most users don't know they exist.
The semi-easiest way to install an FKEY is to make it look like a font, and drop it in the fonts folder. This makes installing and de-stalling FKEYs as easy(?) as installing fonts: drag it into the system folder. If you look at the SendToBack package, you'll see an empty font suitcase; this is the FKEY. To install it, drop it into your system folder. The short description of why this works is this: At startup, the system loads every font in the Fonts folder into memory. When you install a new font (or an FKEY in font's clothing), the system will kindly load the new font into memory so other applications can use it. Because the FKEY looks like a font, the system loads it into memory, and thus the FKEY is activated. Also, since the FKEY is not really a font, it doesn't appear in font menus.
Installing Other FKEYs:
While the nifty trick mentioned above works well on SendToBack, it doesn't work so well if your FKEY does not look like a font. In this case, either have a nearby hacker install it or find yourself an FKEY utility. Once you've got the utility, it's documentation should tell you all about FKEYs, and how to install them or how to renumber them with ResEdit, and if it's a really handy utility, it'll even install the FKEY for you. I'm not going to tell you how to tweak your FKEYs with ResEdit, I'll just tell you it's possible. If you know what you're doing, go ahead and use ResEdit, if you don't, then don't. I view ResEdit as a kind of file-eating reptile; Even if you take care of it, scratch behind it's ears, keep it clean and take it for walks, it's still a file-eating reptile, and it still gets hungry. ResEdit especially likes fresh, juicy files that don't have backups... moving on...
About the Source Code
The source code is available in C and Pascal (written first in pascal, for all you pascal fans out there), so take your pick. You can find it in here.