NOTE: This is beta software. Please don't run this program on machines that would get you in a lot of hot water if something goes wrong. Please see the file TODO before filing a bug report and see if it isn't something that I'm already working on. Introduction ------------ Thank you for trying SwitchMaster. SwitchMaster is a small utility that allows the user to control which tasks should/shouldn't be seen in the OS/2 Window List (CTRL+ESC), Jump Sequence (ALT+ESC), or both. Background ---------- I wrote SwitchMaster because I don't like having open folders included in the OS/2 Window List. Trying not to re-invent the wheel, I evaluated some of the other 'Window List control' type utilities but none of them did exactly what I wanted them to do. It seemed like the perfect reason to put all the money I've spent on OS/2 programming books to good use. Now you get to enjoy the fruits of my labor. As this is my first 'real' OS/2 program, I'd appreciate as much feedback as possible. Aside from SwitchMaster being the first OS/2 PM program I've ever written, this is also the first utility I've felt is useful enough to release publicly for others to evaluate. Taking that into account, please try to keep the flames to a minimum if/when you find a bug. The idea is to encourage me to keep on releasing new utilities for OS/2. :) Requirements ------------ SwitchMaster was written using the emx development system version 0.9a with the third series of fixes (emxfix03.zip). To run SwitchMaster you will need to have installed that level or greater of the emx runtime libraries. The required DLL's are not included here. You can find the required DLL's at ftp://ftp-os2.nmsu.edu/os2/32bit/unix/emx09a/emxrt.zip - SwitchMaster will only run on OS/2 2.1 and later. E-Mailware! ----------- SwitchMaster is E-Mailware. What that means is that you can do whatever you want with the program as long as you send me some E-Mail telling me how you liked it (or didn't like it). My E-Mail address is listed at the end of this document. Other than that, SwitchMaster is 100% free of charge. With that price, you also get something else...NO WARRANTY. Disclaimer (the non-legalese form): If there are bugs in SwitchMaster that totally destroy your computer (which I highly doubt there are), don't blame me. If you use this program, you are doing so at your own risk. Bug reporting ------------- If you do find a bug in SwitchMaster (which I'm sure there are some), please let me know. As this is supposed to be a learning experience for me, I want to find out what I did wrong so I don't do it again. My E-Mail address is listed at the end of this document. Usage ----- SwitchMaster is pretty easy to use. Just create a program object that points to whatever directory you put SwitchMaster in and fire it up. NOTE: SwitchMaster expects to see its initialization file in the same directory that it was started from. With that in mind, you may want to specify the SwitchMaster directory in the field marked 'Working Directory' in the program object settings. Once SwitchMaster is up and running, you should be greeted with the SwitchMaster main window. The SwitchMaster Window ----------------------- The radio buttons grouped under the heading 'Remove From' denote where you want the task(s) to be removed from. There you will find three options: o Window List o Jump Sequence o Both Selecting 'Window List' removes the tasks from the Window List only (i.e. what shows up when you hit CTRL+ESC). This way you can still jump to the task via ALT+ESC, but you can't see it in the Window List. Selecting 'Jump Sequence' removes the tasks from the ALT+ESC Jump Sequence only. This way you can still see the task in the Window List, but you can't switch to it using the ALT+ESC keystroke. Selecting 'Both' removes the tasks from both the Window List and the Jump Sequence so the tasks are completely invisible to OS/2's switching mechanism. The check boxes grouped under the heading 'Remove' define what tasks should be removed. There you will find six options and a button: o Folders o All PM Apps o Seamless Win Apps (disabled) o Full Screen Win Apps (disabled) o DOS Apps o OS/2 Text Apps o Setup... Selecting 'Folders' will activate the 'folders kludge' (see section titled _Technical Stuff_) and try to remove any open folders from the Window List. Please let me know how this works on your machine. Selecting 'All PM Apps' removes all Presentation Manager applications from the Window List. Since all folders are, by definition, PM tasks, selecting this option will disable the 'Folders' checkbox. Selecting 'Seamless Win Apps' will remove all Windows applications that are running seamlessly on your Desktop from the Window List. THIS OPTION IS CURRENTLY DISABLED. Please see the section titled "Common Questions & Answers" for an explanation. Selecting 'Full Screen Win Apps' will remove all Windows applications that are running in a full screen Windows session from the Window List. THIS OPTION IS CURRENTLY DISABLED. Please see the section titled "Common Questions & Answers" for an explanation. Selecting 'DOS Apps' will remove all windowed and full screen DOS applications from the Window List. Please see the section titled "Common Questions & Answers" for an explanation of odd behavior that may occur when selecting this option. Selecting 'OS/2 Text Apps' will remove all windowed and full screen OS/2 applications from the Window List. The setup button is described below in the section titled "The Tasks to Store Window". Taking up the good portion of the lower half of the window is a listbox titled 'Removed Tasks'. This window will show you what tasks are currently being removed. This window will change when tasks are opened and closed. Above the 'Removed Tasks' window is a spin button labeled 'Timer'. 'Timer' defines how often SwitchMaster should look at the Window List and take out the offending tasks. This number can be anywhere from 1 to 10 seconds. The Tasks to Store Window ------------------------- Pressing the 'Setup...' button in the Remove group will bring up a dialog box titled "Tasks to Store". This dialog box allows you greater control to specify only certain tasks to remove from the switch list. On the left side of the dialog box, a listbox shows whichs tasks are currently availble for removing. Only those tasks which aren't already being removed by selecting the aforementioned checkboxes will be listed here. For example, if you have 'All PM Apps' selected on the main screen, then only Windows, DOS, and OS/2 Text Mode applications will be listed. On the right side of the dialog box is a listbox which shows which tasks have been defined by you to be removed. Only tasks specifically defined by you will be listed in this window. To flag a task to be removed, highlight the task in the 'Current Tasks' window and click the 'Store ->' button. If the task isn't already there, it will be moved to the 'Stored Tasks' window. Do this for each task you wish to flag for removal. When you have flagged all the tasks you want, press the OK button. You should now see those tasks you've flagged appear in the 'Removed Tasks' window. If you wish to save your selections for the next time SwitchMaster is run, select the 'Save Settings' option from the 'File' menu. To remove a task from the 'Stored Tasks' list, select the task you no longer want SwitchMaster to process, and click the '<- Remove' button. If the task isn't already in the 'Current Tasks' list (which it shouldn't be), it will be moved there. Repeat this step for all tasks that you don't want SwitchMaster to process anymore. The Menu Bar ------------ The 'File' menu has one option: 'Save Settings'. Select this when you've got all the options set up the way you want. That way the next time you run SwitchMaster, it will default to those options. The 'Options' menu has two options: o Start Minimized o Exit After Load When 'Start Minimized' is checked SwitchMaster will start in a minimized state the next time it is started. When 'Exit After Load' is checked, SwitchMaster will start with all the current options set, stay in memory for 5 seconds, then exit. All tasks that SwitchMaster removes will not be added back to the Window List when it exits. This option is handy for users who want just a couple of tasks removed on startup, but don't want SwitchMaster in memory taking up clock cycles and memory after that. To set SwitchMaster up for Exit After Load: o Check the option under the Options menu o Save the settings (under File menu) o Exit and restart SwitchMaster SwitchMaster will then load, process the current window list, and exit, leaving whatever tasks it processed out of the Window List. To turn this option off, run SwitchMaster and uncheck the Exit After Load option. You only have 5 seconds to do this so be prepared! Remember to save the settings again so SwitchMaster knows not to exit again the next time it loads. If you load SwitchMaster again after it has run through the Exit After Load processing, you will notice that already removed tasks don't show up in the Removed Tasks list. This is expected behavior as SwitchMaster only removes tasks that aren't already removed. NOTE: You cannot get the items SwitchMaster removes back into the Window List unless you reboot your machine or close/start all the windows that SwitchMaster processed. The 'Help' menu has one option: 'About SwitchMaster'. That is pretty self-explanatory. NOTE: Be sure to select Save Settings under the File menu whenever you make a change. By design, SwitchMaster allows experimentation of options and only permanently sets them when Save Settings is selected. SwitchMaster will not warn you when exiting that options have been changed since it was started. That's it for what it takes to run SwitchMaster. Technical stuff --------------- As mentioned before, in my evaluation of the other utilities that do the same sort of thing that SwitchMaster does, I noticed one sorely lacking feature, that being removing open folders from the Window list. After reading up on how OS/2 stores entries in the Window List, I discovered that there is a reason why this feature hasn't popped up yet anywhere else...OS/2 doesn't differentiate open folders from other PM programs! This makes is difficult to block only the folders without also turning off other PM programs that are running. The solution: After spending quite a few hours in the debugger trying to figure out how to make the 'best guess' at telling the difference between PM apps and folders, I discovered that all open folders had the same session ID as the Desktop. Bingo! The only problem is that there are other applications that also share the Desktop session ID. Most notably: o The Desktop itself o The Minimized Window Viewer (also a folder) o The LaunchPad (OS/2 Warp only) o The Workplace Shell o Probably some others... The solution then, was to 'scan' for the Desktop ID and remove everything with that same ID, except those tasks outlined above. Yes, it's a kludge, but it's the best solution I've found so far. If you can think of any other way, I'm all ears. The drawback is obvious, if there are other tasks that share the same session ID as the Desktop that I didn't define above, they also get taken out of the Window List. This includes most object defined in the Templates folder (scheme palette's, etc). The only way around this is to scan for all the SOM objects and make sure they stay put. As I don't have access to the SOM toolkit, this isn't going to happen for awhile. NOTE: SwitchMaster performs it's magic by looking at a window's title. If, for instance, you renamed your 'Minimized Window Viewer' to 'Min Window Viewer', SwitchMaster will not see it. Perhaps I'll add the functionality to define window titles in a later release. Common Questions & Answers -------------------------- Q: When I close a window that SwitchMaster has removed from the Window List, the focus isn't always returned to the window that opened the one that I'm closing! What gives? A: Actually this occurs only when you tell SwitchMaster to remove tasks from the Jump Sequence (or Both). OS/2 deals with open Windows on the Desktop in a strange way. Even though, for example, a folder opened within another folder would appear to have some sort of parent/child relationship, it doesn't. The sub-window is owned by the Desktop not the window that opened it. OS/2 appears to use the Jump Sequence order to determine which window to return the focus to when another window is closed. Since SwitchMaster will alter the Jump Sequence if asked to, it messes up this internal ordering. The solution would be to write a system hook that scans for all WM_CLOSE messages, puts the original Jump Sequence back the way it was, let OS/2 process the call, then put the altered Jump Sequence back. As system hooks are supposed to be quick, I decided not to implement it. For now, the only thing that can be done is either live with it, or only select for windows to be removed from the Window List. I might come back to this later. Q: Why are the 'Seamless Win Apps' and 'Full Screen Win Apps' checkbox's disabled and why is the 'DOS Apps' checkbox also removing Windows tasks from the switch list? A: The OS/2 C header files define different program-type ID's for the various executable types that it can execute. However, it appears to ignore the program types defined for Windows applications and lumps them under the catagory of DOS apps. Thus, by selecting either of the 'Win Apps' checkboxes in SwitchMaster, nothing would happen. Selecting the 'DOS Apps' checkbox, however, ends up removing not only the DOS apps, but the Windows apps, too. I guess this makes sense since Windows requires DOS to run, but why are there different program ID's defined in the headers then? I asked the question 3 times on comp.os.os2.programmer.misc, but nobody ever came up with an answer. Needless to say, until I can figure out how to reliably determine the difference between a DOS task and a Windows task, the options for Win Apps will remain disabled, and selecting 'DOS Apps' will also process all running Windows applications. Q: My SWMASTER.INI file got corrupted and SwitchMaster is having a tizzy fit. A: SwitchMaster is a small utility and doesn't have a lot of extra fancy features. There is no 'recovery mode' or 'regenerate mode' if the INI file becomes corrupted. The easiest solution is to keep a copy of the archive file around and re-extract the default INI file if yours should break. Author Info ----------- To reach me and tell me what you think (and/or report a bug), send your E-Mail off to: Wes Santee wsantee@wsantee.oz.net <--- new e-mail address Enjoy!