Console v1.5 Sep 2005 ===================== for Windows NT/2000/XP Copyright (C) 2001-2005 Marko Bozikovic This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Send bug reports, bug fixes, enhancements, requests, flames, etc., and I'll try to keep a version up to date. I can be reached as follows: bozho@kset.org Console icon is Copyright (C) 2001-2005 by Ante Vukorepa (orcinus@kset.org) 1. Requirements =============== WinNT 4.0 SP4 or later (it won't work on Win9x/Me) IE 4.0 (or later) installed. 2. File list ============ console.exe FreeImage.dll FreeImagePlus.dll console.inf console.xml console_big.xml console_small.xml devel-changes.txt Readme.txt License.txt Tab Completition.reg FixedMedium*.fon TerminalMedium14.fon 3. Installation =============== Unzip Console.zip file somewhere :-) If you'd like to have "Console here" in the Explorer right-click menu for drives and directories, install console.inf file (right-click on console.inf and choose "Install") Remember to do it in the Console directory! 4. Uninstall ============ If you have installed console.inf (see "Installation" section), run "Add/Remove Programs" Control Panel applet and remove "Console Here Extension". Delete all the files. 5. Overview =========== Console is a Win console window enhancement. It was inspired by eConsole (http://www.informatik.uni-frankfurt.de/~corion), a great console-enhancement program (unfortunately, it seems that it's no longer being developed) Console features include configurable font, color, size, background image and transparency (on Win2000 and later) Console is *not* a shell. It's simply a nice-looking front end for a shell of your choice (cmd.exe, 4NT, ksh, Cygwin bash, etc.) 6. Acknowledgements =================== A big thanks to Ante Vukorepa for the program icon. Also, big thanks to Alen Ladavac for help with painting optimizations. Many thanks to code contributors: - Francois Leblanc for mouse wheel messages patch - Daniel Soto for adding multiple monitors support - Dean Scarff for adding stuff - Adam Hodson for adding flat scrollbar support - Daniel Cheng for making Console window looking like a regular window when is set to 'tray' or 'hide' - Rob Davenport for config reload prompt patch and initial comments in the sample console.xml file Thanks also goes to all the people using and testing Console, reporting bugs and asking for new stuff :-) 7. Included fonts ================= The fonts included with Console are XFree86 'misc' fonts converted to TTF. I added them here, since Windows could use nicer console fonts. If you wish to use them, simply install them as you would any other TTF font (go to Control Panel -> Fonts and follow instructions :-) I guess these fonts are distributed under XFree86 licence, and if you think I'm in violation of any licence terms by providing these fonts, please drop me a line. 8. FreeImage library ==================== Console uses FreeImage library for background image loading and manipulations. Console source distribution includes only FreeImage library, include and DLL files. Complete source code for FreeImage can be obtained at: http://freeimage.sourceforge.net 9. Configuration & usage ======================== 9.1 Running Console ------------------- The first thing you might want to set is your COMSPEC environment variable, since that is the shell Console will start. Set it to your favorite shell (cmd.exe, 4nt.exe) Console command line syntax: console.exe [] [OPTIONS] is the path to the configuration file. If ommited, Console will try to locate console.xml configuration file in console.exe directory. If the path contains blanks, enclose it in double quotes. Options: -c - sets initial shell command -t - sets default window title -r - sets default new configuration auto-load flag You can pass initial shell command by using "-c" switch. If the command string contains blanks, enclose it in double quotes. If the command string itself contains double quotes, put two double quotes for each double quote appearing in the command string. E.g: console.exe console.xml -c "cd ""C:\Program Files""" Note: If you use cmd.exe as your shell, you must use /k switch in your command line string (4NT doesn't need the /k switch): console.exe console.xml -c "/k " -t switch specifies the default Console window title. Using the 'title' attribute in the config file will override this switch. -r switch specifies the default new configuration auto-reload flag. Possible values are: 'yes', 'no' and 'prompt'. 'prompt' is the default. Using 'reload_new_config' tag in the config file will override this switch. 9.2 Copy/Paste -------------- To copy text, press and hold shift+left click (or simply left click if Console is not mouse draggable) Drag to select text, and then left-click inside the selection to copy. Left-click outside the selection clears it. If you set copy_on_select tag to true, the selection will be copied immediately after releasing the mouse button. You can paste text into Console using shift+right click or middle click (you might want to disable middle-button click support for Console in your mouse drivers for better performance) Note: text selection and copy work for fixed-width fonts *only*. Use Lucida Console or the supplied fonts (if you have any nice looking free fixed width fonts, feel free to share them :-) 9.3 International characters ---------------------------- Console fully supports Unicode characters, so it should be able to handle all national characters, but there are some things to note: The font you use in Console must include international characters (this one is obvious, isn't it? :-) Supplied FixedMediumXX fonts don't include all of them. I have found some FixedMedium Unicode fonts, but I wasn't able to convert them from bdf to ttf format yet. Your best bet is using Lucida Console font supplied with Windows. After that, you have to configure the Windows console. Start Console and unhide Win console. By default, the Win console uses the Raster Font that doesn't have international characters. Open Win console properties and on the Fonts tab change the font to Lucida Console. Click OK and on the next small dialog select "Save properties for future windows with the same title" This will make Win console windows started by Console use Lucida Console font that has international characters. 9.4 Controlling Console from other applications ----------------------------------------------- Console can be controlled from other applications that support sending messages to application windows (e.g. PowerPro) Console can handle messages for its menu commands sent from other applications. The other application should send WM_COMMAND message (0x0111 in hex, or 273 decimal) to the main Console window, with wParam set to command ID, and lParam set to 0. Command IDs (decimal values) are: Show Readme.txt file...............40001 Show About dialog..................40002 Copy selected text.................40003 Paste from clipboard...............40004 Toggle 'always on top' status......40005 Toggle show/hide Windows console...40006 Edit configuration file............40008 Reload settings....................40009 Exit Console.......................40010 For selecting a configuration file, wParam should be between 1000 and 2000 (1000 being the first .XML file in the startup config file direcotry, files sorted by filename, ascending) 9.5 Maximizing Console window ----------------------------- Console window can be maximized by setting 'rows' and/or 'columns' of the tag to 'max'. Maximum number of rows and/or columns is determined by both maximum Windows' console dimensions and maximum Console window size. The smaller will be used (since Windows console cannot be resized beyond desktop size) If the size of your Console window is limited by Windows console maximum size, you can choose a smaller font in Windows console properties. Note that increasing the number of rows and/or columns and reloading the settings can sometimes result in a corrupt output. I haven't found a solution for this yet, but it seems that restarting Console solves the problem. 9.6 Misc stuff -------------- Using left button double click you can toggle between z-order selected in the configuration file and "always on top" z-order. Right-click pops up a menu. You can copy/paste text from the menu, toggle 'always on top' and 'hide console' flags, work with configuration files. You can switch configuration files by selecting a file from 'Select configuration file' submenu (currently active configuration file is checked) and reloading configuration. Configuration files are enumerated from the initial configuration file's directory. You can drag-n-drop a file or directory to Console. If several files are dropped at once, they will be sent to Console, separated by spaces. Filenames that contain spaces will be enclosed in double quotes. The supplied .reg file is a registry file that will turn on file and directory name completion for cmd.exe (thanks to Rob 'insanitee' for the idea) To install it, just double-click on it, and click 'Yes'. You can map console font colors to custom values (see configuration section) Check out supplied console.xml for an example with default values. Color indexes for default colors are: 00 - Black 08 - Gray (bright black) 01 - Blue 09 - Bright blue 02 - Green 10 - Bright green 03 - Cyan 11 - Bright cyan 04 - Red 12 - Bright red 05 - Magenta 13 - Bright magenta 06 - Yellow 14 - Bright yellow 07 - White 15 - Bright white 10. Configuration file ====================== The console configuration file is a simple xml file. Here's a general layout of the configuration file: 8 false false Lucida Console 150 150 bottom left 10 regular true 10 10 120 false 1 normal alpha 2.bmp true true true prompt If you ommit tags and/or attributes, default values will be used. Here are the tags and attributes: console ------- Description: root tag Parent: none Attributes: - title -> sets the console window title (default: console) - change_refresh -> change refresh interval (in ms) for window repaint (default: 50) It controls how long window repainting is delayed after a change has been detected in the real console. The minimum value for this setting is 5. Note that small values will increase CPU usage when console contents changes rapidly (like dumping a large text file on the console) - refresh -> sets main refresh interval (in ms) for window repaint (default: 500) Console window is periodically refresh even if there are no changes detected. This is needed for proper operation of some DOS programs (eg, RAR). You can switch this off (by setting it to 0) to reduce CPU usage, but some DOS programs will not be displayed correctly (if at all :-) - shell -> sets shell program, overriding COMSPEC environment variable (if you change this while Console is running, you'll have to restart it for chages to take effect) - editor -> specifies text editor that will be used to edit the configuration file (notepad.exe by default); if the program is not in your PATH, you'll need to specify the full path - editor_params -> specifies additional parameters to be passed to a text editor used to edit configuration file and view the Readme file; %f in editor_params will be replaced by the configuration/readme file name; if there's no %f in the editor_params, the configuration/readme file name will be concatenated to the editor_params string; if there are spaces in the filename, place " around %f ("%f") Data: none Note on 'change_refresh' and 'refresh' attributes: Console v1.4 introduced some window painting improvements, increasing the speed and reducing CPU usage. You might want to set these parameters much lower for better performance (something like 5-10 for 'change_refresh' and 100-200 for 'refresh') ------ Description: Sets the font and its properties Parent: console Attributes: none Data: none ------ Description: sets font size in points Parent: font Attributes: none Data: font size in points (default: 8) ------ Description: sets font's bold flag Parent: font Attributes: none Data: true/false (default: false) -------- Description: sets font's italic flag Parent: font Attributes: none Data: true/false (default: false) ------- Description: sets font color Parent: font Attributes: - r -> 0-255, sets Red component (default: 0) - g -> 0-255, sets Green component (default: 0) - b -> 0-255, sets Blue component (default: 0) Data: none Note: if this tag is not present, Console will use font colors from the real console (useful if your shell, like 4NT, supports different coloring options) -------- Description: groups font color mapping tags Parent: font Attributes: none Data: none ---------- Description: maps color No. XX to a new color Parent: colors Attributes: - r -> 0-255, sets Red component (default: 0) - g -> 0-255, sets Green component (default: 0) - b -> 0-255, sets Blue component (default: 0) Data: none Note: XX goes from 00 to 15 (you may ommit colors you don't want to change) See 'Misc Stuff' section above for color indexes ------ Description: sets font's name Parent: font Attributes: none Data: font name (default: Lucida Console) ---------- Description: groups window position tags Parent: console Attributes: none Data: none --- Description: sets initial window X coordinate Parent: position Attributes: none Data: X coordinate Note: Set to -1 to let the system place the Console window at startup --- Description: sets initial window Y coordinate Parent: position Attributes: none Data: Y coordinate Note: Set to -1 to let the system place the Console window at startup -------- Description: sets initial window docking position Parent: position Attributes: none Data: docked position: none, bottom left, bottom right, top left, top right (default: none) --------------- Description: sets window snap distance Parent: position Attributes: none Data: snap distance in pixels; use -1 for no snapping (default: 10) --------- Description: sets window z ordering Parent: position Attributes: none Data: window z-order: regular, on top, on bottom (default: regular) ------------ Description: groups window appearance tags Parent: console Attributes: none Data: none -------------- Description: sets real console window visibility Parent: appearance Attributes: none Data: true/false (default: true) ---------------------- Description: sets timeout for initial console hiding (during startup); some shells need real console window visible during startup in order to initialize properly Parent: appearance Attributes: none Data: timeout in milliseconds (default: 0) ----------------- Description: sets initial 'minimized' status Parent: appearance Attributes: none Data: true/false (default: true) ---------------- Description: groups scrollbar attributes (if visible) Parent: appearance Attributes: none Data: none ------- Description: sets scrollbar background color Parent: scrollbar Attributes: - r -> 0-255, sets Red component (default: system default) - g -> 0-255, sets Green component (default: system default) - b -> 0-255, sets Blue component (default: system default) Data: none