Middle Mouse Menu
Version: 2.0

1. Configuration

  All configuration are done in config file. Open it with a text editor and change
the params you need, below you can see section detailed info.

1.1 Options 
  In this section you can configure global program options.

- title = the title that appears in menu
- options = the options entry name to display, this record are set for let user 
to set them in their language, for example i could set them to "Opzioni" for 
italian people.
- exit = the exit entry name, like options it could be change to your prefer
text so for example "Esci" could be the text for italian.
- timedelay = the time in second to wait before the release of the middle mouse 
menu button. If the time is minor the menu is not displayed.
- hotkey = an hotkey to show the menu, you could assign also an hotkey to show 
the menu, this is usefull for example on laptop that does not emulate the 
middle mouse button.
- tray = 1 or 0 to show or not show the tray icon. If you press non the icon in 
tray the menu is showed
- icon = Is possible to specify a file containing the icon (ico or icon library 
like dll) and icon number (by default if not specified is assumed to be 0) to
assign to icon in tray.
- items = this is where you have to define the base menu item list for the 
first menu items, each of them must be separate with a semicolon (;). Each 
element must be defined in its section and could be a submenu or a record, see
2 for entry details and 2.1 for submenu or 2.2 for record entry.

2. Record type
  Each record could be a menu or a entry, so is possible to create a menu that 
contain a submenu and an entry, for what could be done with entry see the 2.3
paragraph.
  Each record must have a name and must be declared with the name= record in
config file.
  Is possible to define an icon for each element (menu or entry) by using icon=
and set them to path to icon or icon library (like dll) and icon number comma 
separated (by default is assumed to be 0).

2.1 Submenu entry
  For define a submenu you need to specify the name of the menu and the items
that are member of this menu, after that you must specify each items type.
  For example if i want to define a menu (menu1) that contains 1 submenu 
(submenu1) and 1 entry (record1):

[menu1]
name=Menu 1
items=submenu1;record1
icon=Shell32.dll,4

[submenu1]
name=Submenu 1
items=record11;record12

[record1]
name=Record 1
value=http://www.underatrain.it
action=RUN
wait=0
icon=Shell32.dll,3

2.2 Record entry
  For define a record you must provide a name, and a value, and some of other
info that differs according to the type of action required specified in action
value.

2.2.1 Run something entry
  This type of entry (action=RUN) run a program or the default program for a 
specified file, for example if you specify a value of a text file it open the 
system default program for open this file.
  You can specify if the menu must wait the close of the program launched 
(wait=1) or to open and continue to work (wait=0).
  Is possible to set the working (workdir) directory (by default it is set to the menu
directory) and if the window must be minimized (window=min), maximized 
(window=min) or hide (window=hide).
  Is possible to start command in admin mode with admin=1, or start command using
different user (runasuser,runasdomain,runaspassword).

[record-run-site-maximized]
name=Open program main site
value=http://www.underatrain.it
action=RUN
wait=0
window=max

[record-run-cmd-in-c-minimized]
name=Open C:\ in cmd
value=cmd.exe
action=RUN
wait=0
window=min
workdir=C:\

[record-run-wait-config-file-editor]
name=Change configuration
value=MiddleMouseMenu.cfg
action=RUN
wait=1

[record-run-admin]
name=Change configuration
value=cmd
action=RUN
admin=1

[record-run-cmd-as-user2]
name=Change configuration
value=cmd
action=RUN
runasuser=username2
runaspassword=password.user2
runasdomain=localdomain


2.2.2 Clipboard entry
  This entry set the value of your clipboard (action=CLIPBOARD) record to the 
specified value.
  Is possible to set a message (message) that appear under the mouse cursor and
a timeout (timeout) for disappear this message.


[record-clipboard-no-message]
name=Program site
value=http://www.underatrain.it
action=CLIPBOARD

[record-clipboard-message-disappear-after5sec]
name=Clipboard with tooltip
action=CLIPBOARD
value=http://www.underatrain.it
message=Value http://www.underatrain.it insert in clipboard. Paste to check.
timeout=5

  
2.2.3 Message entry
  This entry display a message popup (action=MESSAGE) and is possible to set a
timeout (timeout), a title (title) and text message (text). Must also be 
specified the type of message (type=info or type=yesno).
The type info display only message and the type yesno set the value to clipboard
if the user press yes.
In case you select type yesno the value is copied to clipboard if you press yes,
if is specified a timeout must also be provided the default action (default=yes 
or default=no) in case of timeout.
In the text message is possible to use [$NEWLINE$] for add a return carrier.

[record-info-timeout5sec]
name=Message info
text=The site of this program is http://www.underatrain.it
title=Example of message simple
type=info
action=MESSAGE
timeout=5

[record-timeout]
name=Message yes or no with timeout
text=If you press yes the value "UndeR A TraiN" is inserted in your clipboard.[$NEWLINE$]If timeout (after 3 sec) is like you press yes.
default=yes
value=UndeR A TraiN
title=Yes or no to clipboard
type=yesno
action=MESSAGE
timeout=3

2.2.4 Send entry
  This entry emulate the button pressure (action=SEND), so you could set the to 
string for example if you want to write the string "This is the better middle 
mouse menu program" simply set the value to this string.

[send-string]
name=Write the program url
action=SEND
value=http://www.underatrain.it

2.2.5 Path entry
  This entry build a submenu (action=PATHDIR) with all files and directories of 
the folder specified in the path record (path=C:\Develop\MiddleMouseMenu for 
example).
  Is possible to specify a icon for directory (directory=) or for each extension
(txt=,doc=) or the default (default=). The default icon is used only if icon for
the file extension is not found, if it is not specified the menu does not display
any icon, the samme happen if you do not specify directory icon. Each icon must
be specified in the syntax path-to-icon,icon-number or 
path-to-icon-library-like-dll,icon-number if icon-number is omitted the program
assume you set them to 0.
  If you use icon an icon cache file is generated in the application directory
this is always overwrited by extension param specified in each entry.
  Is possible to choose if unknow icon for the extension must be found in 
the default system icon record in regedit (usesystemicon=1) or not, the default
behaviour is to not use it (usesystemicon=0)
  Is possible to choose if the menu must show the "explore directory" option,
and if you want to set them in the top or at the bottom of element list with
addoperdirectory=Text to show as explore folder. If you want to make this text
at the top add ,1 (comma and the number 1) at the end:
addopendirectory=Explore [$RELATIVEPATH$] ...,1
  In the text you could use the vars:
    - [$NAME$] = folder name
    - [$PATH$] = full path
    - [$RELATIVEPATH$] = relative path from the path value specified
  If you don't specify anything is assumed that you don't want this item, in 
this case you could use the showemptydirectory function (showemptydirectory=1 or 
0). With this function is possible to choose if the empty directory must be 
showed (value 1) or not. If you set addopendirectory value this value is ignored.
  If addopendirectory and showemptydirectory are not specified is assumed that
showemptydirectory is set to 1.

[path-record-emptydir]
name=Middle Mouse Menu
icon=Shell32.dll,13
; the icon and name specified here are the icon and the name applied to the root menu record
action=PATHDIR
path=C:\Develop\MiddleMouseMenu
txt=Shell32.dll,2
default=Shell32.dll,1
directory=Shell32.dll,4
addopendirectory=Explore [$RELATIVEPATH$] ...,1

[path-record-noemptydir]
name=Middle Mouse Menu No Empty
icon=Shell32.dll,13
; the icon and name specified here are the icon and the name applied to the root menu record
action=PATHDIR
path=C:\Develop\MiddleMouseMenu
txt=Shell32.dll,2
default=Shell32.dll,1
directory=Shell32.dll,4
showemptydirectory=0


3. Example
  This is an example config file.
  
  
[info]
version=2.0

[options]
title=---> Middle Mouse Menu <---
timedelay=20
menuitems=menuid1;menuid2
; Hotkey Ctrl, Alt, Shift, Win, F{1..12}: Function keys
; Combo with + for example Ctrl and z: Ctrl+z
hotkey=Win+z

[menuid1]
name=Menu id 1
items=submenuid1;menuid3;record1
icon=Shell32.dll,4

[menuid2]
name=Menu id 2
items=submenu2;submenu2-1

[record1]
name=Record 1
action=SEND
value=http://www.underatrain.it
icon=Shell32.dll,14

[submenu2]
name=Another submenu
items=onlyrecord11;newrecord22

[submenu2-1]
name=Another submenu
items=newrecord22

[onlyrecord11]
name=Record 1-1
value=http://www.underatrain.it
action=RUN
wait=0
;workdir=
;window=

[newrecord22]
name=Record 2-2 - Clipboard without tooltip
value=http://www.underatrain.it
action=CLIPBOARD

[submenuid1]
name=Submenu 1 of menu id 1
items=onlyrecord11;onlyrecord12;onlyrecord12

[onlyrecord12]
name=This is a record insert 2 times on same menu
action=MESSAGE
type=info
title=Title of message window
text=Text to show
timeout=5

[menuid3]
name=Menu id 3
items=anothersubmenu1;recordxyz

[anothersubmenu1]
name=A submenu
items=record-msg-yesno;record-timeout

[recordxyz]
name=Clipboard with tooltip
action=CLIPBOARD
value=http://www.underatrain.it
message=Value http://www.underatrain.it insert in clipboard. Paste to check.
timeout=5

[record-msg-yesno]
name=Message yes or no
text=If you press yes the value "UndeR A TraiN" is inserted in your clipboard.
default=yes
value=UndeR A TraiN
title=Yes or no to clipboard
type=yesno
action=MESSAGE

[record-timeout]
name=Message yes or no with timeout
text=If you press yes the value "UndeR A TraiN" is inserted in your clipboard.[$NEWLINE$]If timeout (after 3 sec) is like you press yes.
default=yes
value=UndeR A TraiN
title=Yes or no to clipboard
type=yesno
action=MESSAGE
timeout=3
