Yet Another Menu (Yam)


This program reads a menu file and creates a cascading popup menu. Because the fact the program is only started when you need it, it does not take up any cpu or memory when you are not using it! Start it using the mouse or create a shortcut in the startmenu/desktop and set a hotkey for it.

More or less everything in the GUI is customisable. You can change background color, selected item background color, custom font and colors. It is also possible to use custom background pictures in the menu. It is easy to translate everything in the program with a simple text file. It also has some special commands:

 * Multiple actions from one menu item. E.g. start a couple of program and web links at once.
 * Append clipboard string to file.
 * Transform from copied files to a string with the filepaths. Useful if you want to append files
    as parameter for other programs or to create playlist from copied files...
 * Copy the content of a file to clipboard without opening the file itself. As a sort of template clipboard.
 * Close windows with a specified string in the title.
 * Print files with default program.
 * Print text from clipboard.
 * Use any format of the current date and or time in the menu, as parameters to any program or for
    appending in files.
 * You can also use multiple menu files for different needs.


Installation
Copy the exe file to a folder of your choice. That's it! Now run the program and a sample menu file will be created in the same folder as the exe.


Menu item settings
In the same directory as the program there will be a mnu-file with the same name as the exe file (if there is no file, run the program once). The syntax is as following:
Name[tab]program.exe|parameter|startIn|ShowAs
   or
Name[tab]program.exe|parameter|startIn|ShowAs[tab]program.exe|parameter|startIn|ShowAs[tab]program.exe|parameter|startIn|ShowAs[tab]...

In the following examples I use [tab] because of the fact that tabs does not look very good in html. If you want to use an example in your own menu file, change the [tab] to an actual tab in e.g. notepad.
This is an example of a submenu:
[Folder name
   Start Notepad[tab]notepad||%windir%
   [Subfolder name
      Start IE[tab]iexplore||%windir%
   ]
]

Show as
This command is to control how the window should be shown, e.g. normal, maximized, minimized. I just added the possibility to use any of the standard paramters in Windows. Test which one suits you needs. These are the available commands:
   0 = Hide.
   1 = Show normal, this is the default value.
   2 = Show minimized.
   3 = Show maximized.
   4 = Show no activate.
   5 = Show.
   6 = Minimized.
   7 = Show minimized no activate.
   8 = Show na.
   9 = Restore.
   10 = Show default.
Start notempad minimized[tab]notepad.exe|c:\temp\test.txt|%system32%|2

Separator
Any line starting with an hyphen will be transformed into a separator in the menu.
-

Column
Add a | infront of the item name to create a column. At the moment this only looks good if there is the same number of items on each columns. Maybe I will look at it sometime...
|Notepad after column[tab]notepad.exe||%system32%

Relative paths
You can use "..\" to go up one folder from the yam's folder or ".\" to start in the yam folder or go down from it. This is very useful if you run YAM from an USB drive as I do.
start a prog[tab]..\anotherFolder\program.exe

Web links
If you want that the url should open a new browser window of the default program make sure the url starts with "http://", "https://" or "www". Otherwise you can use a link to e.g. Internet Explorer and put the link as a parameter. Then the url does not have to start with anything special.
Virtual Plastic[tab]http://virtualplastic.net

Strings from clipboard
The following row start a search on google with the text that has been copied to the clipboard.
Search copied string[tab]http://www.google.com/search?q=¦s

Furthermore you can create mailto links
mail[tab]mailto:someone@isp.com&subject=Hi&Body=¦s

¦s copy the parameter to the clipboard as string
Open copied link in FireFox[tab]C:\Mozilla\FireFox.exe|¦s

The ¦s can be used to start links to.
Start from Clipboard[tab]¦s

File path(s) from clipboard
If you have ¦f in a command you can make some copied files and send them as inparmeters to a file. (file1 file2 ... fileN) You can use the strings StringBefore, StringDelimiter and StringAfter to create the complete string.
Copied file(s) as parameter to other prog[tab]C:\folder\program.exe|¦f

Or start a copied file.
Start copied program[tab]¦f

Accelerators
& makes a accelerator to get to that item on the menu. The following row makes 'p' an accelerator
note&pad[tab]notepad

Date and time stamp
¦d(YYYY-MM-DD) gives you the current date. You can use any format you want. If you do it like in the example you will have the date in the menu itself. Or you can create a file with the current date. If you try to do somehting "DDth of MMMM YYYY" it will be translated wrongly, the h will be resolved as the hour with one digit. To resolve this use the escape char \ like this "DDt\h of MMMM YYYY".
The date in the menu ¦d(YYYY-MM-DD)
Start a file with current date[tab]notepad.exe|¦d(YYYY-MM-DD).txt|%system32%

Append a string to a file
¦a copies the content of the clipboard to a specified file. The following command will save the string from the clipboard to a file. It will also add the current time and a new line after the time. NB! This does not work with files larger than 32 kb.
Append clipboard to file[tab]¦ac:\temp\CollectingPhoneNumbers.txt|¦d(HH:mm)\n¦s

Copy file content to clipboard
¦c copies the content of a file to the clipboard.
Copy mailaddress[tab]¦c|c:\temp\myMailadress.txt

Close windows with a specified string in the title
¦x closes all windows that has the specified string in the title. This is a soft close, i.e. if there are unsaved changes the program asks if you want to save it or not. The string is case in-sensitive.
Close Notepad[tab]¦x|notepad

Create a menu structure from a folder structure
¦q allows you to create a menu structure from a folder strucure. It is possible to specify what folder and what mask to use. If no mask is specified only folders are created. If you want to show all files and folders in the menu use * as a mask.
¦qA folder structure, text and ini files|c:\temp|*.txt;*.ini
¦qA folder structure, only folders|c:\temp
¦qA folder structure, all files except mp3 and ogg files|c:\temp|*|*.mp3;*.ogg

Environment variables
It is possible to use environment variables like %temp% and %windir% in strings
Open file in temp folder[tab]%temp%\readme.txt

Print files
¦p|¦f sends _one_ file that is copied to the default printer. Note that not all files can be printed this way.
Print copied file[tab]¦p|¦f

Print text from clipboard
¦p|¦s prints the clipboard (if it is text) to the default printer using the default program for text-files.
Print the clipboard[tab]¦p|¦s

Comments
Any row starting with a ';' is considerd a comment and is ignored.

Grayed out menu item
Any row starting with '¦g' is considerd a greyed out menu item. This can be useful for a date that is only used to be shown in the menu, not to be selected.
¦gToday is: ¦d(YYYY-MM-DD)

Multiple actions from one menu item
It is possible to run more than one command from one menu item.
nameToShow[tab]programOrUrlToStart|parameter|start in[tab]programOrUrlToStart|parameter|start in[tab]programOrUrlToStart|parameter|start in...

Multiple menu files
You can use more than one mnu-file for the program. If you for example want one for internet links and anotherone for normal programs. To have another file than the default mnu file have a shortcut that has a target like this.
C:\program files\yam\yam.exe yam2.mnu


Visual settings
To edit the visual settings of the menu use the following commands in the menu file. Use one line for each setting. Use a space between the settingsname and the rest of the string.
All the color settings use the same format. R,G,B. Each value can be from 0 to 255.

Background color
This is the background color for the normal menu item text.
@BGMenuColor 255, 255, 255


Selected item background color
This is the background color for the selected menu item text.
@SelBGMenuColor 150, 150, 220


Text color
This is the font color for the normal menu item text.
@TextColor 0, 0, 128


Selected text color
This is the font color for the selected menu item text.
@SelTextColor 0, 0, 0


Font size
This is the font size for all menu item text.
@FontSize 9


Font bold
This is the font bold for all menu item text. Use 1 for using bold and 0 for normal.
@FontBold 0


Font italic
This is the font italic for all menu item text. Use 1 for using italic and 0 for normal.
@FontItalic 0


Font name
This is the font used for all menu item text.
@FontName Arial


Use skin
This setting it to turn on or off the picture skins. Use 1 for using pictures as background and 0 for using only colors. It is used together with SkinBackground and SkinBGSelected or the default pictures.
@UseSkin 1


Skin background
If the standard background picture does not suits you it is easy to change it. Use absolute or relative paths for the background for the normal menu item. If the image is to small it will be tiled/repeated. If the image is to big only a part of the image will be shown. Big images like wallpapers is no problem to use. It is possible to use any gif, jpg and bmp image.
;@SkinBackground .\img\xp2.jpg


Selected skin background
If the standard background picture does not suits you it is easy to change it. Use absolute or relative paths for the background for the selected menu item. If the image is to small it will be tiled/repeated. If the image is to big only a part of the image will be shown. Big images like wallpapers is no problem to use. It is possible to use any gif, jpg and bmp image.
;@SkinBGSelected .\img\xpSel2.jpg


String before copied files
When using ¦f it is possible to add a string before all the paths. It is possible to use \n for a new line and \t for a tab.
@StringBefore "


String delimiter for copied files
When using ¦f it is possible to add a string between the paths. It is possible to use \n for a new line and \t for a tab.
@StringDelimiter " "


String after copied files
When using ¦f it is possible to add a string after all the paths. It is possible to use \n for a new line and \t for a tab.
@StringAfter "


Language file
To change all the strings in the program use absolute or relative paths for a language file. It can be created using the settings GUI in the program.
@LanguageFile .\Svenska.lng

Parameter delimiter
If the default parameter delimiter | isn't suitable for you because it is used in some other paramters, just change it to something else.
@ParameterDelimiter ¤

Menu editor
If you want to use a specific editor when selecting "Edit the menu", it is possible to add the special command @MenuEditor. Use it with the same settings like any other program. "¦m" is replaced with the current menu file.
@MenuEditor ..\Win32pad\win32pad.exe|¦m

Custom icons for menu items
To add a custom icon (or full background) for any menu item use the special command @CustomIcon. The first parameter is the name of the menu item that you want to add the custom icon that is the second parameter. Any menu item with that name will have this icon.
At the moment the icon will blend with the background if especially if the background is dark. To solve this, at the moment, you can add a mask image. It is a black and white image that uses white where the icon should be transparent and black where it should not be transparent. It is possible to use any gif, jpg and bmp image.
@CustomIcon &Internet|.\img\FireFox.gif
@CustomIcon &Internet|.\img\FireFox.gif|.\img\FireFoxMask.gif

Removing default menu items
It is possible to remove one or more of the default menu items (Settings, Edit the menu, About..., Help, Exit or the whole sub menu). The special commands for this is @NoProgramMenu, @NoHelp, @NoSettings, @NoEdit, @NoAbout and @NoExit. The default is to show these commands. If you do not want them add a line in the menu file with the special commands and a 1 after it. This will remove that menu item or the complet sub menu.
@NoProgramMenu 1
@NoEdit 1

No Icons
It is possible to remove all icons by adding the NoIcons special command. This will make the menu more narrow.
@NoIcons 1


Skins
Skining is possible, but it may slow down the speed a bit. You can change things like background (picture or color), selected background (picture or color), selected textcolor, fonts etc.


Translation
It is possible to translate everything in the program. In the menu file point out what language file you want to use with the @LanguageFile setting. Create a template for the language file by starting the program choose settings and click on the button Create new. A new file with the name Translation.lng will be created. Edit that file to match your language. Change the name and add a reference to it in the menu file. See the description of the @LanguageFile.

If you do a translation, feel free to send it to me and I will add it to the download.


Program name
If you don't like the name of the program, change it! It will by default use a menu file with the same name as the program file. It will also have that name in the menu and as titles for the different windows or message boxes it shows. The only place it stays the same is in the about windows with my own name, I hope you can live with it! =)


Do you want more features
Do you want more things like the programs icon and xp style on the menu there is an good alternativ in ShortPopUp.


Uninstallation
Remove the all files in the same directory as the exe file and that is it! Nothing is written to the registry or any other folder than the folder where the yam program is in.


Bugs
At the moment it is not possible to use ¦c for files larger than 32 kb at the moment.
There is also one 'feature', if you are really quick and click a key or the mouse after you started yam but before it has showed it self, you have to use the mouse because the program loses focus and still shows on top.


Disclaimer
Stolen from TinyApp.org: "You are 100% responsible for your own actions. Using this site, visiting a link, downloading a program, in short, living, is done entirely at your own risk (and joy)."

Basically use this software is at your own risk, it is provided for use "as is" without warranty of any kind. But I haven't had any problems with it! =)


Thanks to
I got the code for ownerdrawn menus from G. D. Sever at www.elitevb.com, thanks for it!


History
3.7.1
Added the possibility to create a sub menu from a folder structure with multiple file match filters and exclude filters. Fixed environment variables to work.

3.7
Added the possibility to create a sub menu from a folder structure.

3.6
Added the possibility to remove one or more of the default menu items.

3.5
Fixed msic bugs, added URL encoding when using http-links

3.4.2
If no menu font is specified, use the users default menu font.

3.4.1
Added the possibility to remove all icons.

3.4
Added a check to see if the custom icon exists, if not don't use it.

3.3
Added the possibility to use a custom icons for the user configurable menu items.

3.2
Added the possibility to use a custom specified menu editor when editing the menu from the menu itself.

3.1
Made some small tweaks. Also added the possibility to use a new setting for "Show as" to be able to minimize or maximize programs you want to start.

3.0
A complete rewrite of the program. It is now much faster and has a nicer menu file with the extension mnu. The ini-file is removed because it is slow to read from and write to.

2.2
Fixed some small changes and made the close program close all existing windows not only the first window it found.

2.1
Made the program faster in the submenus and removed repeatedly ini files checks.

2.0
Added skins



Have fun!
Henrik
http://henrik.atspace.com