AutoHotkey: TC Fav Menu: Features and Installation

From TotalcmdWiki
Revision as of 11:15, 4 July 2006 by Majkinetor (talk | contribs)
Jump to: navigation, search

TC FavMenu

& Menu Editor

                      for Windows XP & 2K





TC FavMenu is standard Open/Save dialog enhancer and application launcher. It uses the ini file to store information about your favorite folders and applications and it is designed so to be portable.


Format of the menu ini file is compatibile with the Total Commander file manager directory menu, and was originaly written to work as addon for this file manager but it can be used without it (with some options disabled). All features of the TC directory menu are supported, including plugins and pseudovariables. Furthermore, TC doesn’t need to be started.


Menu Editor can be used to create, edit, delete and organise menu items. This is complete replacement of TC’s internal directory menu editor witch adds many new options. It can be used together with FavMenu or as separate application.


Both programs use the same ini file to store configuration, Config.ini.





You can run applications either by starting .exe or .ahk  files. If you want Total Commander executable and its configuration file wincmd.ini to be automaticaly recognised start application from within TC. To run .ahk, you must have AutoHotKey installed. Make sure you have something in the TC directory menu before start using the program.






- Full TC favorites. Possible items in the menu are:






cd path

cd c:\program files    cd %SYSTEMROOT%\System32


cd \\\plugin

cd \\\Uninstaller      cd \\\Registry\HKEY_CURRENT_USER\Sofware


cd %$var%\path

cd  %$DESKTOP%          cd %$PERSONAL%\My Pictures




c:\boot.ini            will be resolved via associations

%w%%s%%n%              where w=C:\windows, s=\system32, n=notepad.exe

%UTILS%\Edit Plus\Editplus.exe "c:\boot.ini" "c:\1.txt"



- Enter (on menu item)


·        Open/Save dialog is active (commctrl32.dll dialogs)





change the path in the dialog


open or activate TC


run the application


·        Any other window is activate: open or activate TC


- CTRL + Enter (on menu item)

Open Properties dialog with selected item. Move around with buttons. You can change title, command and set icon.  Press Save on every individual item to save changes (title will change to notify you that save is complete).  It is much faster to use this dialog then TC's editor for single item change.


If Properties dialog is open you can use Favmenu to change the currently displayed item by calling the menu and pressing <ENTER>. So favmenu can not be used until Properties dialog is closed.


- SHIFT + Enter (on menu item)

  Open selected item in new TC tab


- Setup dialog

On first run, Setup dialog will search for TC location in the registry and if not found it will also try  %COMMANDER_PATH%  environment variable. If not present in the aystem, this variable  will be instantiate by TC privately.  If setup can not find Total Commander, specify full paths to totalcmd.exe and wincmd.ini yourself.

In case you want to start TC with parameters, create link to the totalcmd.exe and edit link info as you desire. After that specify the path to the totalcmd.lnk instead totalcmd.exe.


Later, you can call this Setup dialog via the tray menu.


          - Current directories,   Editor  &   “Add current dir”  items

If TC is open, current left & right folders will be displayed at first 2 positions. If they are the same only 1 will be visible.  If menu is called with TC active, this will not be displayed.


Add current dir item works only when TC is active and has the same meaning as in TC.


Configure… item (Editor) can also be set as a last item in the menu. This method is preferable to set the Editor,  since you will not have double configuration enteries in the Favmenu, because this item is not  contained in  the menu declaration.


All 3 can be enabled/disabled via Setup dialog.


- Automatic Refresh

Menu is refreshed on every call, so if you update your favorites in TC changes will be  seen immediately.


- Office Dialogs

Solid support to Office 2003 Open/Save dialogs (it doesn't work if ListView is focused)

  Make sure your carret is in the edit box next to the   File Name  and you will not have any problems.


- Icons

You can specify an icon to display beside menu item. Icons are 12x12 with first pixel holding transparent color. You have more then 100 icons included in the package for you private use.


- Pseudovariables

  Similar to environement variables, but has slightly different syntax (%$var%, instead %var%).

  Currently supported:



Application Data, new for NT4


All Users\Application Data


All Users\Documents


C:\Documents and Settings\username\Desktop




Non roaming, user\Local Settings\Application Data


My Music folder


My Pictures


My Documents


C:\Program Files\Common


C:\Program Files


C:\Documents and Settings\username\Start Menu\Programs


%windir%\Resources\, For theme and other windows resources.


C:\Documents and Settings\username\Start Menu


C:\Documents and Settings\username\Start Menu\Programs\Startup.


System Directory (usualy C:\WINDOWS\System32)</p&amp;gt;


Windows Directory (usualy c:\Windows)


NOTE: Not all above pseudovariables are currently supported in TC but they may be in future versions.





Menu Editor is separate application that can be used to edit & organise the menu. If you already have Config.ini created by the use of the FavMenu it will use existing configuration. If you don’t use TC FavMenu, Menu Editor will try to find wincmd.ini or ask you on failure.


If you want to edit single item the fastest way is to use FavMenu’s itegrated Properties dialog (CTRL ENTER).


Editor can be added to the end of the Favmenu menu via its Setup dialog.


- SHIFT Up/Down

Move an item, or entire submenu.

While moving, when you encounter submenu, if it is expanded, current item will become its child or will be removed from it.

Otherwise, item will jump over the submenu.


- F2

Change the title of an item. Use & to set a shortcut and to specify separator.



Press ENTER after changing the Command or Icon field to save changes. Selected item will

turn bold and *** will appear in the dialog to inform you that the item has been changed, but it is not yet

saved to the disk.  Everything will be saved into the menu configuration after you press SAVE button.

Button will be grayed while save is in progress.



Press insert to add new menu item after currently selected. Hold shift to insert new submenu.

When the last item of the submenu is deleted, submenu will be turned to simple menu item.



Remove the item or complete submenu.


- Browse buttons

>> buttons can be used to speed up editing.

If the first word in the command field is “cd”, browse for directory dialog will be displayed, otherwise, browse for file. You must still press ENTER to save changes.


- Settings

If settings tab in Menu Editor is hidden, use CTRL TAB to select it. You can change the look and behavior of the editor here.




You may encounter some problems related to Total Commander interaction with the menu. It is the best to avoid using TC editor at all, since FavMenu Editor is much faster and functional plus TC editor will delete menu information about your icons if you set them. You can use “Add current dir” TC option without any problems.


-  If you have empty sub menus, script will not work.


-  If you have 2 submenu items with the same name, in order to see the second one, you must add pseudospace (ALT 0160) at the end of the title of the second one. For all subsequent items with the same name add additional pseudospace.


-  Menu is collected from the wincmd.ini [DirMenu] section. Format of this menu is:


            menuN =  title | - | -title | --

            cmdN  =  cd <path|plugin|pseudovarialbe> | executable


While building the menu, section will be iterated sequentially up to the first menuX item that doesn't exist. If, for some reason, your TC menu has "hole" in a sequence, script will rise errors or will not display the complete menu.

This menu, for instance will not work:







To make sure your menu is not messed-up, open TC Favorites configuration and click OK button. TC will rebuild the menu sequentially. If you still have problems, delete everything (backup wincmd.ini first) and create your menu again. And if you still have problems (very unlikely), visit developing forum to report this. If you have any other mistakes in menu syntax script will not work.


-  Win9x systems are not and will not be tested. If it works, cool, but if not,  don't ask for support.




If you are AutoHotKey user, you can include Favmenu and Editor in you own scripts.

This is an example:



= 1

     SetWorkingDir <path to favmenu>


= FavMenu_Init(g, "FavMenuSubmenu", false)


= Editor_Init(g, “”, false)


     Menu, Tray, Add, FavMenu :FavMenuSubmenu




#Include <path to Favmenu & Editor>

#Include FavMenu.ahk

#Include Editor.ahk


Init functions must be called in your autorun section to initialise scripts. Parameters are:

ByRef Param1     last GUI number used. This is automatically, just set the g to 1 and add g as a first parameter in every next Init function call. Function will return new gui number incremented with the count of GUIs used in the script

Tray submenu     Since you can run several scripts together, you set here the Tray submenu that script will use for its own menu enteries. After that, add it in the tray with the Menu command. If you leave this parameter empty, the menu will be added to the Tray itself.

Standalone         Set this to false. This flag notifies the script that it is not used standalone but as a part of merged environment.


     From this point you can use following functions:


          FavMenu_Create()        Show the FavMenu.

          Editor_Run()            Starts the editor 


          FavMenu_Options_*       set ini option, replace * with ini value from [TCFavMenu] section

          Editor_Options_*        set ini option, replace * with ini value from [Editor] section



        For instance, this will set Win + P to show FavMenu at thre mouse position and Win + N to show the Editor:


          t == FavMenu_Options_MenuPos      ;save current option

          FavMenu_Options_MenuPos == 1      ;mouse postion

          FavMenu_Create()                  ;show the menu

          FavMenu_Options_MenuPos==t      ;restore saved option








If you want to know more about script merging download my article:

<a href="">Autohotkey: Constructive Language Criticism & Script Merging</a>





-         Settings to include desired non-standard windows, by your choice, like Office dialogs, Start->Run, console, and basicly anything you would like to paste path into.

-         Larger icons

-         Support for standard “Browse for folders” dialogs

-         “Add current directory” in dialogs also.






Created by Miodrag Milic

in Autohotkey ->

using Windows XP Pro




homepage:  |   |


Belgrade, Jun 2006