CloseWorkBench v1.0 Stephen Johnston sjjohnst@descartes.uwaterloo.ca This is a set of two utilities which open and close the Workbench screen on demand. They are designed to be used in combination with other utilities, such as AutoPubScreen, that open their own screens and you wish to save memory by closing the Workbench screen. It also acts as a screen blanker and keyboard lock if the Workbench is the only screen open. :-) Please send any flames, bug reports, etc to the author. Background: I originally wrote this program in C so that I could run Term (by Olaf Barthel - best 'comm program ever) on its own screen on an Amiga 500 with only 1mb of memory. Term didn't leave a lot of memory left on that machine, so every little bit helped. Then I bought an Amiga 1200, and had a different problem. I wanted an 8 colour Workbench screen, but only 4 colours for CLI windows. I had a Multiscan monitor for a while, and it was also nice to have Workbench on a DBLNTSC screen, with CLI on a non- interlaced screen so I could read it better. I started using PSX (Steve Tibbett) to open a public screen, and opened all my CLI windows here. I insert my "CloseWorkBench" command into the S:Shell-Startup file, and every time I hotkey a new CLI (using KCommodity, QMouse, or whatever), the Workbench would close down and I'd get my CLI on a (faster) screen with less colours. I re-wrote in Assembler in order to return result codes and to reduce the size. Its now about 20% of the original size. The one problem with this is that I always had that screen open. This problem is solved by using AutoPubScreen. (Steve Lemieux - it can be found on Aminet and is highly recommended with this program) This program opens up a new public screen whenever it is needed. So if you start a shell with the line NEWSHELL "CON:0/0/640/400/MyShell/Screen MyScreen" the screen "MyScreen" will be opened if necessary. Additionally, this screen will be closed automatically once all windows on the screen are closed. Perfect! 8 colour WorkBench, 4 colour CLI, each only opened as required. Installation: Simply copy the two files to somewhere where your path can find them, such as C: Usage: CloseWorkBench - 308 bytes (91 byte version string) - takes no parameters or tooltypes. - runs from an icon. This has an neat effect if you have an "exploding windows" program like KCommodity running! - returns the following result codes: 0 - Workbench closed. 5 - Workbench not closed, either because it wasn't open or there is a "visitor" window on the Workbench screen. Not really too serious. 20 - Intuition.library could not be opened. You should consider this a serious error. If you see this you're probably headed for a GURU because you've got to be in bad shape to get this error. - don't close the Workbench screen if you don't have anything else running! (Don't say I didn't warn you!) - once all other screens are closed, Workbench will auto- matically re-open. But only if a screen was open before CloseWorkBench was started. OpenWorkBench - 204 bytes (91 byte version string) - takes no parameters - does not run from an icon. This would be pretty pointless anyway. - returns the following result codes: 0 - Workbench opened. 10 - Workbench not opened. Either Workbench is not running, or their is something wrong with Intuition. Consider this a fairly serious error. Either user screwed up, or Intuition did. 20 - Intuition.library could not be opened. See above for general comments. Bugs: Closing the Workbench screen when it is the only screen opened may result in an unusable system. If you can hotkey some other program active, you will be OK. If not, you must give the Amiga a three finger salute. (Ctrl-Amiga-Amiga) This is _NOT_ a bug. It is a "KeyBoard / Screen Blanker / Lock" Under DOS 1.3 it also becomes a mouse excerciser; under DOS 2.04 and 3.0 it becomes a mouse blanker. I suppose this could be fixed by checking to see whether other screens are open... As the RKM's say, "The name of this function is improperly spelled. Should be (Open)CloseWorkbench."* I wouldn't worry about this too much if your using AmigaDOS; it takes your input either way. :-) Tested on an Amiga 500 (512K chip, 512 fast, ECS, DOS 2.04 & 1.3) and Amiga 1200 (2mb chip, AGA, DOS 3.0) *Amiga RKM Manual, Includes and AutoDocs, 3rd edition, pg315. Legal: The author cannot and will not take any responsibility for any damaged software or hardware caused by the use of these programs. The are distributed to the general public as freely-distributable shareware. There is no fee for its use, but if you wish to send something to the author, (who is a starving student) he would be eternally grateful :-) There is no copyright on included soft- ware, you can do as you wish. If you do make any modifications to either program, I would like you to send me a copy. Source code is available on request, but can be summarized in the following: Open Intuition, jsr _LVOCloseWorkBench, Close Intuition (plus Workbench startup) History: v1.0 - first (and probably only) public release. Written in Assembler. v0.9 - not publically released. Written in C. Credits: Richard Desjardine - the artist for the icon. Steve Lemieux - the author of AutoPubScreen Author: I am a University of Waterloo student, but as I am in co-op, I am only at school on alternating four-month cycles. Mail will always reach me on Internet, but unless I get access to Internet on my next work term, I won't be replying to mail between Sept. '93 and Dec. '93! Snail mail may be faster then; scary! Stephen Johnston sjjohnst@descartes.uwaterloo.ca 170 University Ave. West #12-198 Waterloo, Ontario N2L 3E9