WinButtons v3.6.1.0, 2012-10-23 by Ath
--------------------------------------
Display (large) buttons on screen to send keyboard actions or start an application.
Built in response to a Coding Snack request from the DonationCoder.com forum at http://www.donationcoder.com/forum/index.php?topic=25167.0
There it is to be used on a touch-screen, so large buttons would be useful.
Can switch the set of available buttons when an application (or a control on a window of an application) gets focus, see the [Groups] section documentation.
Can enable/disable buttons, based on conditions like existence of files, an exe being loaded, and some logical operations (and, or, not)
v3.2.0: Handles Files dropped on top of a button (configurable per button)
v3.3.0: The default file-extension is changed from .ini to .wbuc, so if WinButtons.wbuc and WinButtons.ini both exist in the current directory then WinButtons.wbuc is opened.
WinButtonEdit has an option to associate the .wbuc extension with WinButtons so double-clicking opens it with WinButtons (or WinButtonEdit, users choice)
v3.3.1: Added support for displaying icons from .exe, .dll, .ocx and .icl files, in the same fashion as .ico files.
v3.3.2: Adds support for optional resizing of .bmp images on buttons to button-size
v3.4.0: Adds support for CursorRestore feature, to restore the cursor to the last position outside of the WinButtons Window, intended for use with an external (USB) touch-screen
v3.4.1: Improvements for CursorRestore feature, with configurable buffersize and performance enhancements
v3.4.2: Adds support for FlipKeyColor and SelectButton features, improvements on -send [last] and application-focus, adds DCUpdate feature using dcuhelper
v3.4.2.3: Minor bugfix release
v3.5.0: Support for Borderless buttons added, that allow all types of graphics support by GDIPlus, including PNG, and combining Labels and images on a button
v3.5.1: Support for forced line-split by using @LF@ (multple if needed) in the caption on Borderless buttons.
v3.6.0: Added support for [VarParams] section, optionally enabling entry of parameters for buttons, that can be accessed by using the [Variables] defined in that section.
		If this option is enabled, the tooltip per button shows the command to be executed, instead of any tooltip set.
		Added support for a global ConfirmMsg formatstring and option per button to enable a default Yes/No,Ok/Cancel,No/Yes,Cancel/Ok messagebox before the command is ecxecuted (default choice mentioned first) Default formatmessage: Execute command:\n'%s'
v3.6.0.2: Bugfix release. Details: see WinButtons.au3
v3.6.1: Opens a dropped .ini or .wbuc file with a non-empty [Buttons] section as a new configuration, if not dropped on a button with On Drop (dropcommand) defined.

Display 1 or more buttons in a rectangle form, with or without a border, and when with border, optionally show a (Windows) close button and/or a caption. <Esc> closes the window, when exitonesc is not disabled.
Buttons can display a text, an icon or a bitmap (bmp), be colored, a fontsize set, differ in size, have a hotkey when displaying text, be separated in rows, and ordered either horizontally or vertically.

Revision history can be found in the source: WinButtons.au3
-----------------------------------------------------------

Commandline parameters:
-----------------------
-d :			Debug log mode, write extra debugging and logging information to WinButtons.log. Most useful if placed as first on the commandline, then also logs during command line parsing.
-d- :			Debug log mode disabled.
-f inifile :	Filemode, read configuration from inifile, instead of WinButtons.wbuc/WinButtons.ini. -f can be ommitted.
-t <top> :		Top pixel of the window that shows the buttons, -1 means vertical screen-center is used.
-l <left> :		Left pixel of the window that shows the buttons, -1 means horizontal screen-center is used.
-w <width> :	Width of the buttons to display. Default is 128.
-h <height> :	Height of the buttons to display. Default is 128.
-m <margin> :	Margin between buttons and the windows border, and between each button. Default is 2.
-r <rows> :		Number of rows to separate the available buttons in. Default is 1.
-x :			RunExit mode enabled. Closes WinButtons after a button is pressed and it's command executed.
-x- :			RunExit mode disabled (default).
-v :			Vertical mode enabled, draw buttons from top to bottom instead of left to right.
-v- :			Vertical mode disabled (default).
-mv :			Movable mode enabled, allows dragging the form across the screen, when grabbed by it's border or background, using the mouse.
-mv- :			Movable mode disabled (default).
-ta :			Taskbar mode enabled, show a taskbarbutton in the Windows taskbar.
-ta- :			Taskbar mode disabled (default).
-b :			Border enabled, show a border around the window.
-b- :			Border disabled (default).
-cl :			Close button enabled, show a close button on the window, the Window Border (-b) should also be enabled!
-cl- :			Close button disabled (default).
-o :			Ontop mode enabled, Button windows floats on top of all windows (default).
-o- :			Ontop mode disabled.
-hnd handle :	Add handle to the list of window handles to hide when -hide or -hidex command switch is used, an be specified multiple times
-e :			Enable ExitOnEsc mode (default), to close the WinButtons window by pressing <Esc>
-e- :			Disable ExitOnEsc mode, pressing <Esc> won't close the WinButtons window.
-fs <size> :	Fontsize for use on all buttons in points (default font is fixed at 9 pt)
-a :			Enable ActiveExe option, to generate a list of executable names that got focus during this WinButtons session. Appended to WinButtons-active-exes.log when WinButtons is closed.
-ah :			Enable Alternate Hide method for another way of hiding the windows. Can also be set using althide configuration setting.
-ah- :			Disable Alternate Hide. (default)
-cs <separator> :	Set an alternate Multiple Command separator string. Default is ^, proposed alternative is &&, as ^ can not be combined with -send
-cr :			Enable CursorRestore mode, so the cursor is restored to the last known position outside of the WinButtons window, as requested by nudone, to support an USB touch-screen. Can also be set using the cursorrestore configuration setting. Sets the buffer to Regular (2).
-cr- :			Disable CursorRestore mode. (default)
-fc :			Enable FlipKeyColor mode, reverts the color of button background and button caption, if these colors are set or set globally. Used to indicate the button was activated. Stays inverse while the button executes, or if it return quickly, delays to display at least 250 msec. Can also be set using the flipkeycolor configuration setting.
-fc- :			Disable FlipKeyColor mode. (default).
-lh <pid>		Allows the last handle <pid> from a previous instance of WinButtons to be passed on to a sub-instance, like command "-sub -lh [last] other.wbuc"
-sb <button>	Set this button (number) as the Selected Button after initial display. (can be used like "-sb 4 numkeypadr.wbuc" to initially select the 'NumPad Off' 4th button from that layout)
-? :			Help mode, display a messagebox with all available commandline options.
Any commandline option overrides the corresponding setting from the inifile.

inifile settings:
------------------------------------------
The [Settings] section:
------------------------------------------
This is a sample [Settings] section of the inifile, all settings are shown with their default value. It applies to the current instance of WinButtons.
None of the values need to be present to have a working configuration, the defaults will then be used.
[Settings]
debug=0
caption=
runexit=0
left=-1
top=-1
buttonwidth=128
buttonheight=128
buttonmargin=2
vertical=0
border=0
closebutton=0
taskbar=0
movable=0
buttonrows=1
ontop=1
winsendkeys=
exitonesc=1
fontsize=9
backcolor=
excludeexes=
althide=
cmdseparator=
cursorrestore=
flipkeycolor=
nobuttonborder=
paramshow=
paramwidth=
confirmmsg=
-----------------
debug :			Debug log mode enabled when set to 1
caption :		The caption of the form showing all buttons. Border must be enabled to display the caption. Environment variables can be used by using %env.variable%
runexit :		RunExit mode. Normally after starting a command, the form stays in place, -runx command can be used to exit this instance of WinButtons or runexit set to 1
left :			Left position of the form, -1 centers the form on the screen, after calculating the width of the form.
top :			Top position of the form, -1 centers the form on the screen, after calculating the height of the form.
buttonwidth /
buttonheight :	Dimension of the button(s) in pixels. All buttons wil have the same size. Default is 128 x 128.
buttonmargin :	Space between the buttons and the form-borders. Default is 2.
vertical :		Display a vertical column of buttons when set to 1.
border :		Display a border around the form when set to 1.
closebutton :	Display a standard Windows close button on the form. If taskbar = 0 a smaller close button is displayed.
taskbar :		Display WinButtons in the Windows taskbar. Allows this WinBottons instance to be selected using <Alt-Tab> or by mouse in the taskbar.
movable :		Makes the form movable when set to 1.
buttonrows :	Number of rows of buttons to display (assuming more than 1 button definition...). The count of buttons is divided by this number to determine the size of the form.
				If a number of buttons is not fully divisable by this number, void spaces are displayed instead of buttons.
ontop :			Determines if the button window is foating on top of all windows, or can be hidden behind other windows. Default set to 1, disabled when set to 0.
winsendkeys :	Specify the path/filename for WinSendKeys.exe (download from: www.donationcoder.com/forum/index.php?topic=25389.0). Not checked for existence, just executed (can be in path).
				Will be read from WinButtons.wbuc/WinButtons.ini, if not found in the current .wbuc/.ini file (and current file is not WinButtons.wbuc/WinButtons.ini)
exitonesc :		When set to zero won't close the WinButtons windows when <Esc> is pressed. Is read from global ini, so sub-menu's should probably provide a button to quit that menu.
fontsize :		The global fontsize to be used for all buttons. Can be overridden by specific button fontsize<n> setting.
color :			The default color of the button-face, can be overridden by a group or button setting
textcolor :		The default color of the text on the buttons, can be overridden by a group or button setting
backcolor :		The background color of the WinButtons window. Color values in rgb, most easy is to use hexadecimal notation with 0x prefix, like 0xff0000 for red.
excludeexes :	The comma-separated list of exe files, not to trigger a change of button context when [Groups] are defined.
althide :		Use Alternate Hide method (WinSetState instead of SetWindowPos) for hiding a Window, in case of re-painting issues.
cmdseparator :	Set the character(s) to be used as Multiple Command separator. Default is ^, proposed alternate could be &&, as ^ can not be combined with -send
cursorrestore :	CursorRestore feature, to restore the cursor to the last known position outside of the WinButtons window, as requested by nudone, to support an USB touch-screen.
				Can be set to values from 0 .. 4, where 0 = Off, and 1..4 determines the buffersize, 1 = Small, 2 = Regular, 3 = Medium, 4 = Large
flipkeycolor :	FlipKeyColor feature, when enabled reverts the button and text color if a button is selected, and resets the colors when the button-action is finished. If the action takes less then 250 msec, it waits the remaining milliseconds so the button is at least 250 msec reverted. Requires colors to be set for text and button surface, either per button or globally/per group or a combination of that.
nobuttonborder:	Enables the Borderless button feature for all buttons.
paramshow:		Enables the display and entry of values for any variables that have at least a prompt set. See also the [VarParams] section. This parameter is not globally loaded, local to this configuration file only.
paramwidth:		The minimal width of the WinButtons window, to ensure the window is wide enough to display the prompt and input control. If the WinButton window is already wider, that value is used. This parameter is not globally loaded, local to this configuration file only.
confirmmsg:		The format-string to be used instead of the default "Execute command:\n'%s'". Use %s in the format-string to embed the command to be executed.
If a setting is not found for: debug, buttonwidth, buttonheight, buttonmargin, closebutton, border, taskbar, ontop, exitonesc, winsendkeys, fontsize, excludeexes, althide, cmdseparator, cursorrestore, flipkeycolor or nobuttonborder in the current file, 
and we are not reading WinButtons.wbuc/WinButtons.ini, then the setting is also searched in WinButtons.wbuc/WinButtons.ini as a global configuration. Local override or command-line option always 'wins'.
-----------------

------------------------------------------
The [Groups] section of the configuration.
------------------------------------------
Groups can be defined to switch the set of available buttons, based on the current application having focus. The selection is made based on the name of the exe file (no path) that is running. 
This information can be obtained by enabling debug mode or -a commandline parameter, starting WinButtons, giving the required application focus, closing WInButtons and reading the last lines of the log file. 
There's a list of the executable names that had focus during the lifetime of that WinButtons session.
Groups have 2 parameters:
group1=scite
exename1=scite.exe
group<n> :		The name of the group, to be used to identify the button-section. This name will be prefixed to '-Buttons' to find the correct set of buttons. 
				So for this group to activate, a non-empty section [scite-Buttons] must be defined, listing a set of buttons as defined in the [Buttons] section readme.
exename<n> :	A comma-separated list of names of executables that should have focus to validate the context-switch to this button-group. The check is done non-case-sensitive.
				Application-exename(s) can be determined by starting WinButtons with -a commandline option, activvating the required app, closing WinButtons and retrieving the activated exename(s) from WinButtons-active-exes.log
				It is also possible to trigger a group-switch by specific controls on a specific window of that exe, the format for the exename is: exename.exe[%["special window title"%]ControlName]. 
				The (optional) window title can be specified like the special names in http://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm in the section Advanced Window Descriptions
				The ControlName can be specified as a regular expression, and should name the ClassnameNN value, as shown by the AutoIt Window Info tool. Usually these names as like Edit1, Edit2 etc. The regex would be Edit[1-3] for Edit1, Edit2 and Edit3.
				These names may not appear of be ditectable in all Windows applications though.
				The regular expression syntax for these is explained in this page: http://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm and the full supported syntax over here: http://www.autoitscript.com/autoit3/pcrepattern.html
If a group is used, some parameters from [Settings] can be overridden by setting them in that [<group>-buttons] section. 
These overridable settings are: left, top, buttonwidth, buttonheight, buttonmargin, buttonrows, vertical, fontsize, color, textcolor and backcolor.
-----------------

---------------------------------------------
The [Variables] section of the configuration.
---------------------------------------------
Variables can be defined in a [Variables] section, to be later used by other [Variables], [Settings] or [Buttons]/[<group>-Buttons] parameters or commands.
A variable could be defined like:
[Variables]
Hello=Hello World!
stdheight=60
stdwidth=2*:varStdHeight:

This variable can then be used in a command or caption, etc., by using a ":var" prefix and a ":" suffix, for example: :varhello: or :varStdWidth:
The :var prefix is required to be lowercase, variablenames are not case-sensitive.
The variables can be used in all configuration items that do _not_ resolve to an on/off value, like vertical or movable. Only numeric and string values get variables replaced.
An example configuration is included as copymenu.ini

Nested variables can be used, the replacement happens from inside out, like this example:
[Variables]
stdheight=100
stdwidth=:varMultiply:varStdHeight:::varStdHeight:
multiply40=4*
multiply60=3*
multiply100=2*

The use of :varStdWidth: resolves to: ":varMultiply:varStdHeight:::varStdHeight:"
The second iteration resolves to: ":varMultiply100:100"
The third iteration resolves to: "2*100"
Assigning this variable to buttonwidth in the [Settings] section, like below, will resolve to 200, as any calculation is also executed when reading numeric values from the configuration.
Example:
[Settings]
buttonwidth=:varStdWidth:
Changing the value of stdheight to 60 will resolve in a buttonwidth of 180, and a stdheight of 40 results in buttonwidth=160.

Variables can also process parameters. An example:
---
[Variables]
root=F:\Projecten\AutoIt\WinButtons\copytest
rootx=.
source1=:varRoot?1:\client\import
dest1=:varRoot?1:\server\import
filespec1=*.*
source2=:varRoot:\server\import
dest2=:varRoot:\client\import
filespec2=
source3=:varRoot:\client\export
dest3=:varRoot:\server\export
filespec3=
source4=:varRoot:\server\export
dest4=:varRoot:\client\export
filespec4=
command=:varCmd: :varSource?1=?2: :varDest?1=?2: :varFileSpec?1: :varParams:
params=/E /MOV ?1
cmd=robocopy

; stuff for VarParams demo:
server=localhost
timeout=

; (Part of the Variables with parameters demo)
[Buttons]
button1=Copy IMPORT from &Client to Server  i >>
command1=-asc"Please confirm|:varCommand=1=x:":varCommand=1=x:
---
Parameter values are passed by using =<value> in the variable: :varCommand=1=x: passes values "1" and "x" when parsing variable Command. These parameters can be applied in the result by using ?<parameter number>, like: ?1 or ?2.
These passed values can again be used as parameter value by preceding them with "=", like: :varSource?1=?2: This results in variable Source1 being fetched (the first parameter to that variable), and passing x to Source1 (the second parameter passed from the command1 button).
In Source1 this value "x" is used to determine the requested Root variable, either Root or Rootx. If parameter 2 is not passed to Command, it defaults to an empty string.
-----------------

---------------------------------------------
The [VarParams] section of the configuration.
---------------------------------------------
This section holds the parameters for the display and entry of variables in the WinButtons userinterface.
When paramshow option is enabled in [Settings], it is always displayed for all button groups defined in this configuration file.
To display a variable as a parameter, at least the 'prompt' setting needs to be set for that variable.
Example-config:
[VarParams]
; The prompt for variable: server
prompt-server=Servername or IP:
; Inputtype Editable combobox with history, the entered new values are added to the list and stored
type-server=3
; A list of values separated by |
values-server=maindc|backupdc|fileserver|sqlserver|backupsrv
prompt-timeout=Ping without time-out?
; Inputtype Checkbox with history, the last selection is stored as the default value
type-timeout=5
; Enabled select /t, disabled selects ""
values-timeout=/t|

prompt-<varname>:	Define the Label caption for the input control. This setting is required to be filled for the parameter to be available for input. Only required parameter to display the input control and label.
labwidth-<varname>:	The width of the label in pixels. When not defined the labwidth value from the same section is used, if defined, if both not defined then the available WinButtons window width is divided by 2, 1 half for the label, 1 half for the input control.
					If labwidth is negative, the label is left-aligned instead of right aligned. The set LabWidth is used as an absolute (abs) value.
type-<varname>:		Type of input control: (Default: 0)
					0 = Textbox
					1 = Combobox with fixed selection-list
					2 = Editable Combobox
					3 = Checkbox
save-<varname>:		How is the data entered/selected saved: (Default: 0)
					0 = Not saved
					1 = Last value/selection saved
					2 = Entered values are added to the combobox list and saved. Last selected value is not saved.
					3 = Combination of 1 and 2. Both are saved.
					Settings 2 and 3 are only applicable to editable comboboxes, type 2
width-<varname>:	The width of the input control. If not set, the value of width set in the same section is used, if defined. See labwidth-<varname>. Width should be >= 0, but when 0 the available window width/2 is set.
values-<varname>:	List of values for Combobox and Checkbox controls. Values are | (vertical bar) separated.
					For input-type 3 the new values are added at the end of the list.
					For Checkboxes, the first value is returned when checked, and the second value, if available, when unchecked. To return an empty string on unchecked, enter an enabled value, followed by a |, as in the example above.
					If no values-<varname> is defined for a checkbox, 1 is returned for checked, and 0 for unchecked. To get Enabled and Disabled as a value, define: values-check=enabled|disabled
labwidth:			Global setting for all label controls that don't have their own labwidth value.
					If labwidth is negative, the label is left-aligned instead of right aligned. The value of LabWidth is used as an absolute (abs) value.
width:				Global setting for all input controls that don't have their own width value. Width should be >= 0.

-------------------------------------------
The [Buttons] section of the configuration.
-------------------------------------------
Each button is required to have at least a, sequentially numbered, non-empty button<n>= value. If the text on a button should be empty, an empty caption<n>= value should be supplied.
[Buttons]
button1=
caption1=
tooltip1=
image1=
command1=
color1=
textcolor1=
buttonwidth1=
buttonheight1=
buttonarrangement1=
fontsize1=
condition1=
conditionmode1=
dropcommand1=
nobuttonborder1=
-----------------
button<n> :		The name of the button. If no caption<n> is supplied, this is also the text displayed on the button. & can be used to define a hotkey for that button, so button1=B&utton defines <Alt-U> as a hotkey for button 1.
caption<n> :	The caption to display on the button. If supplied it takes precedence over the standard button<n> value for display on the button. Allows an empty caption if defined as empty value. The same rules for hotkeys apply.
				Captions are wrapped if no color is used, as these attributes don't play nice together (yet). Environment variables can be used in a buttonid or a caption by using %env.variable%
				The caption is also shown as a tooltip for each button, if no tooltip is defined.
				For a Borderless button, any linefeed in the caption splits it at that position. A linefeed can be specified using @LF@, so Internet@LF@Explorer would display as 2 lines, displaying Internet and Explorer below each other.
tooltip<n> :	The tooltip to display for this button. Overrides the default 'caption' tooltip. AutoIt3 macro's and variables can be used by enclosing them in @ or $, like @CRLF@ to insert a new-line. Full macro documentation in http://www.autoitscript.com/autoit3/docs/macros.htm
image<n> :		An optional icon (.ico, .exe, .dll, .ocx and .icl file) or bitmap (bmp) file to display on the button. Doesn't allow for combination of icon/bitmap and text! If a hotkey is set using an & in the button or caption setting, then that hotkey is still enabled!
				When using an icon, then the icon-index can be specified by adding ",<index>" (no quotes or brackets). The best choise usually is the numeric (negative) index. For .exe, .dll, .ocx and .icl files, the default index (when ommitted) is set to 0.
				When using an actual .ico file that contains multiple size icons, the best icon should be emperically determined, by trying several (usually negative) indexes, these can't be displayed by the icon selection dialog of WBE.
				If a larger iconsize then 32x32 pixels is needed to display on a button, NirSoft's IconsExtract utility could be used extract the desired icon to a .ico file, find the iconindex in the icon by double-clicking it in InconsExtract and selecting the indexnumber with the desired size. Then use the saved .ico file in WBE as Image, using the index shown in IconsExtract.
				IconsExtract can be found at: http://www.nirsoft.net/utils/iconsext.html
				When specifying a .png file (borderless buttons only!), the comma-separated index is the Opacity value that can be set on the image. Range 0..255. 0 is invisible, 255 is 100% visible.
				When Borderless buttons are used, the filename can be prefixed with several parameters to manage the layout and size of the image: 
				!!! Attention: The list of parameters is terminated by a round brace: ) !!!
				[-][<Layout>[,width[,height[,imageborder[,labelborder[,left-offset[,top-offset]]]]]])]
	-			The image is streched in the available space, if a caption is defined, space is reserved for the caption to show properly
	<Layout>	A code for the layout of the image and caption, when both are defined.
				0 = Image at the top, caption at the bottom, image is scaled to the button-apect-ratio, the background besides the image get the same color as the caption background, and also acts as a button
				1 = Caption at the top, image at the bottom, image is scaled to the button-apect-ratio, the background besides the image get the same color as the caption background, and also acts as a button
				2 = Image at the left, caption at the right, image is scaled to 1/2 width of the button, and the caption get the other half.
				3 = Caption at the left, image at the right, image is scaled to 1/2 width of the button, and the caption get the other half.
				4 = Like 0 but the Caption is left aligned
				5 = Like 1 but the Caption is left aligned
				6 = Like 2 but the Caption is left aligned
				7 = Like 3 but the Caption is left aligned
				8 = Like 0 but the Caption is right aligned
				9 = Like 1 but the Caption is right aligned
				10 = Like 2 but the Caption is right aligned
				11 = Like 3 but the Caption is right aligned
	width		Explicitly set width for the image, for layouts 2 and 3 (and corresponding 6/7, 10/11) the caption is resized to fill the remaining space
	height		Explicitly set height for the image, for layouts 2 and 3 (and corresponding 6/7, 10/11) the caption is resized to fill the remaining space
	imageborder	Extra border-pixels around the image so the optional FlipKeycolor feature colors a border around the image to make the 'pressed' state more visible. 2 or 3 seems an appropriate value. The default and also the fallback value on wrong values is 1.
	labelborder	Extra border-pixels around the caption. The entire caption label is reduced in size!
	left offset	Shifts the image to right (positive value) or left (negative value) to move the button-image in the desired location. The caption is not resized by this offset!
	top offset	Shifts the image down (positive value) or up (negative value) to move the button-image in the desired location. The caption is not resized by this offset!
				If one of these parameters is empty it is ignored. 
				Spaces between parameters are allowed.
				Examples can be found in metro.wbuc
command<n> :	The commandline to execute on activation of the button. It has a few optional switches that need to be left-most if used (all lower-case):
	-quit :		Quit this instance of WinButtons. Ignores the rest of the command.
	-exit :		Exit after executing command, like runexit configuration parameter was set or -x commandline option used
	-wait :		Run command, wait until it's finished, and re-activate the WinButtons window.
	-hide :		Hide this WinButtons instance and any window-handles passed using -hnd option, run the command, wait for it to finish and restore WinButtons. This allows an uncluttered screen, as default WinButtons has 'always on top' parameter (ontop) set.
				If you need to hide the menu's only when the last level is shown, then either don't pass :hndlist:, or only use -hide on the last level, or else all previously hidden windows will reappear.
	-send :		Send keys specified to a named window using WinSendKeys (see winsendkeys [Settings] parameter for download including docs). Use -wait to wait for completion of WinSendKeys (not the app controlled by WinSendKeys!)
				When passing the special parameter [last], that is replaced by the hWND of the last activated application, so "-send [last] blah" allows a button to send blah to the current application. See numkeypad.wbuc for an example.
	-sub :		Start another instance of WinButtons with the parameters given. -wait is also turned on
				When passing the special parameters "-lh [last]" with -sub, the secondary instance of WinButtons receives the PID of the last active application before WinButtons was activated. Allows layouts like numkeypad.wbuc to be a -sub instance, and still send keystrokes to the previously active application.
				Use like:
				command1=-sub -lh [last] -t :top: -l :left: -w :width: -h :height: numkeypad.wbuc
				or:
				command4=-sub -lh [last] -sb 4 -t :top: -l :left:-(3*:width:) -w :width: -h :height: numkeypadr.wbuc
	-nowait :	Turn off -wait option (for optional use with -sub)
	-work "workdir" :	Specify a working directory for the command to execute. The path need not be quoted, unless it contains spaces. If it's not quoted, it's terminated with the first space encountered after some valid (non-space) characters. 
						The workdir path isn't explicitly checked for existence, but Windows won't start the command if it can't find that directory.
						Example: (all with the same result)
						command5=-hide-work "c:\tmp "Notepad
						command5=-hide-workc:\tmp Notepad
						command5=-hide-work"c:\tmp"Notepad
						This hides WinButtons while running Notepad, which is started in C:\tmp. The extra space inside the quotes in the first example is ignored by Windows.
	-msg :		Display the rest of the command as a message to the user. This can be used during debugging to display the command, instead of actually executing it. Supports optionally setting a title by having a | as separator. -hide is implicitly set.
	-ask"[title|][*]message" :	Ask with a Yes/No messagebox, displaying the message, with optional title separated by | (vertical bar), confirmation of the user. On No the command won't be executed. -hide is implicitly set.
	-asc"[title|][*]message" :	Ask with a OK/Cancel messagebox, displaying the message, with optional title separated by | (vertical bar), confirmation of the user. On Cancel the command won't be executed. -hide is implicitly set.
			If the message part starts with * then the second button (Cancel or No) is set as the default button, and the * is removed.
			When the button is pressed, any variables in the message or title are replaced.
	-reload :	Causes a reload of the configuration after the button is executed, assuming no -exit or runexit=1 or -x is set.
	-refresh :	Causes the WinButtons windows to be redrawn, without reloading the configuration, after the button is executed, assuming no -exit or runexit=1 or -x is set.
	-recond :	Causes all conditions to be re-evaluated ('recondition'). Is only useful with conditionmode > 0 (or combined with -dis or -vis condition options).
	-mini :		Starts the command in a minimized state. Can be used to avoid 'flashing' cmd prompts for commandline-tools that generate (ignorable) screen-output when executed.
	Switches can be combined, placed side by side, or separated by a space, so a valid command<n> like could look like:
		command1=-hide-exitNotepad somefile.txt
		- This hides WinButtons, and any windows passed using -hnd option, while working with Notepad, and quits after Notepad has returned to WinButtons.
		or
		command1=-wait-exit Notepad somefile.txt
		- This doesn't hide WinButtons, waits for Notepad to end, and then quits WinButtons
		or
		command1=Notepad somefile.txt
		- This runs Notepad, and makes WinButtons directly available again for further actions.
	Environment variables can be used by using %env.variable%, like:
		command1=-hide-exitNotepad %USERPROFILE%\Desktop\notes.txt
	When passing parameters to a command, it can be useful to pass information about the current location of the WinButtons window, or button just selected. 
	Some coordinates are avaliable with these parameters:
		:top:		= top pixel of the control, ignores bordersizes so buttons can align nicely. If a sub-instance of WinButtons is started that has the same border settings, then the buttons can align exactly
		:left:		= left pixel of the control, ignores bordersizes so buttons can align nicely.
		:right:		= right pixel of the control
		:bottom:	= :top: + buttonheight
		:btop:		= button top exactly calculated.
		:bleft:		= button left exactly calculated.
		:bright:	= button right exactly calculated.
		:wtop:		= window top
		:wleft:		= window left
		:wwidth:	= window width
		:wheight:	= window height
		:wright:	= window right (:wleft:+:wwidth:)
		:wbottom:	= window bottom (:wtop:+:wheight:)
		:width:		= button width
		:height:	= button height
		:hndlist:	= A list of all handles passed using -hnd option, and the handle of the current window, to be hidden when -hide is used
		:var<VarName>[=par[...]]:	= Variables with optional parameters, as explained in the [Variables] configuration section, can be used.
	These coordinates can be used in calculations to give nice positioning (if spaces are used for readability, then the calculation should be quoted, examples from the standard WinButtons.ini) like:
	command7=-sub -t :btop:+(:height:*0.75) -l ":bleft: + (:width: * .25)" :hndlist: submenu5.ini
	- This places a submenu (configured using submenu5.ini) at 3/4 down the height of the selected button, and 1/4 to the right, overlapping a large part of the button, but leaving the caption visible. It also passes the list of handles to hide if -hide is used.
	command8=-sub -x 
	submenu4.ini
	- This places a submenu on top of the selected button, overlapping it exactly, assuming both use the same border, taskbar and buttonsize settings
	Multiple commands:
	If multiple commands need to be sent by 1 buttonpress, then they should be separated by a ^ or an alternative set with -cs commandline option or cmdseparator setting, so if we need to create 2 directories, this can be configured like this:
	command1=-wait cmd /c md c:\directory1^cmd /c md c:\directory2
	The second command can run in parallel with the first if no -wait is used!
	Only the last return value is 'preserved' (logged if -d or debug was set).
	Multiple commands can only properly be combined with -send if and alternate for ^ as a command separator is set using cmdseparator setting or -cs commandline option.
dropcommand<n> :	The command to execute when files are dropped on this button.
					The same variables and options like command<n> are available.
					Adds these variables : (only feasible when some files are dropped)
					:dropList:		= List of all files dropped on the button (space-separated, and quoted when containing spaces)
					:dropItem<n>:	= The n-th item in the list dropped (1-based). If :dropItem: or a non-numeric <n> is used then :dropItem1: is assumed. If <n> is out of range of dropped items this variable returns empty. (quoted when containing spaces)
color<n> :			Change the button surface color. Color values in rgb, most easy is to use hexadecimal notation with 0x prefix, like 0xff0000 for red.
textcolor<n> :		Change the caption color of the button, same notation as color<n> parameter. Colors can't currently be combined with a button image.
buttonheight<n> :	Change the height of this button only. If it's taller then the global buttonheight setting, then only this button will be taller, but all other buttons get a bigger margin.
buttonwidth<n> :	Change the width of this button only. If it's wider then the global buttonwidth setting, then only this button will be wider, but all other buttons get a bigger margin.
				If these values differ from the global buttonheight/buttonwidth values, then this button will be differently sized, and smaller button(s) will be centered in the available space.
				If a larger margin between buttons and/or the border is needed, then [Settings] value for buttonmargin should be increased, instead of giving all buttons a different size.
buttonarrangement<n> :	Determine how the button is grouped/sized within a buttonarea.
						Possible values: 1, 2, -2, 3, -3, 4, 6, -6, 9
				1 :		The current button is extended into the next buttonarea, it's possible to have the rest of the buttons fall off the window...
				2 :		The buttonarea is split horizontally in 2, so 2 buttons can be placed into 1 buttonarea, can be combined with 3, 4, 6 and 9, vertical on with -3, 4, -6 and 9
				-2 :	The buttonarea is split vertically in 2, so 2 buttons can be placed into 1 buttonarea, can be combined with -3, 4, -6 and 9, vertical on with 3, 4, 6 and 9
				3 :		The buttonarea is split horizontally in 3, so 3 buttons can be placed into 1 buttonarea, can be combined with 2, 4, 6 and 9, vertical on with -2, 4, -6 and 9
				-3 :	The buttonarea is split vertically in 3, so 3 buttons can be placed into 1 buttonarea, can be combined with -2, 4, -6 and 9, vertical on with 2, 4, 6 and 9
				4 :		The buttonarea is divided into 4 equal parts, so 4 buttons can be placed into 1 buttonarea, can be combined with 2, 3, 6 and 9, vertical on with -2, -3, -6 and 9
				6 :		The buttonarea is divided into 6 parts, 2 horizontal rows, vertically divided into 3 equal parts, and 6 buttons can be placed into 1 buttonarea, can be combined with 2, 3, 4 and 9, vertical on with -2, -3, 4 and 9
				-6 :	The buttonarea is divided into 6 parts, 2 vertical rows, horizontally divided into 3 equal parts, and 6 buttons can be placed into 1 buttonarea, can be combined with -2, -3, 4 and 9, vertical on with 2, 3, 4 and 9
				9 :		The buttonarea is divided into 9 equal parts, so 9 buttons can be placed into 1 buttonarea, can be combined with 2, -2, 3, -3, 4, 6 and -6, also with vertical on
		Several combinations of buttons can be made, so 3x 9, 1x 3 and 3x 9 will fill 1 buttonarea, but 3x 6 and 1x 2 also fill a buttonarea. Experimenting is the best way to find the best way to see if it fits your need.
		When buttonwidth and/or buttonheight are different from the calculated buttonsize, then the smaller of these sizes will be used. 
		These smaller buttons are combined/calculated using the default calculated sizes, not the actual sizes, that's for another release, if required.
		The buttonarrangement type 4 and 9 buttons are drawn from left to right, top to bottom when vertical is off, and from top to bottom, left to right when vertical is on.
fontsize<n> :		The size of the font in points, used for this button only. By default the [Settings] value of fontsize will be used, which defaults to 9pt.
condition<n> :		A condition that has to return true for the button to be displayed.
					Valid condition options are:
					-vis :	Set ConditionMode for this button to 1, show/hide the button on condition change. See conditionmode<n> 1 below for more info.
					-dis :	Set ConditionMode for this button to 2, enable/disable the button on condition change. See conditionmode<n> 2 below for more info.
					-ref :	Refresh condition evaluation every 1/10th second. Having too many -ref conditions can cause performance/responsiveness issues!
					-file"dir or filespec" :	Check for existence of a directory or file specification. Quotes are advised to be used, to accomodate for spaces in names, else the first space is used as a separator.
					-exe"executable name" :		Check for "executable name" (no path should be specified), or a comma-separated list of executables (checked using 'OR' logical condition), to be active in memory. If 'AND' logical condition is required, then use multiple -exe combined with -and options.
												This check is performed at startup, but also when a new process is started, or some process has closed. -ref is not needed for this condition to be re-checked.
					-au3"AutoIt3 functionblock" :		Provide a valid AutoIt function block that results in a logical or numeric (0 : False, <> 0 : True) value. Use @macro@ notation to check specific macro values, documentation: http://www.autoitscript.com/autoit3/docs/macros.htm
														Use -ref to refresh this condition if a dynamic macro value, like @SEC@ or @HOUR@ is used.
					-not, -and, -or :			Conditional keywords to invert (-not) or tie conditions together. Be sure to add a condition after these options to get a valid logical result!
					(, ) :						Use round brackets to group conditions together. Be sure to match the correct number of round brackets to get a valid logical result!
				In the condition statement, all :var<VariableName>: variables, macro expansion using @macro@ and environment variables using %env.variable% are supported.
				When -exe is used, every time a process is started or stopped, the list of conditions that contains a -exe is re-evaluated.
				When -ref is used, every 1/10th second, the list of conditions that contains a -ref is re-evaluated. This might drain performance! A 'flashing' button can be realized by using:
				...
				condition1=-dis-ref-au3"mod(@SEC@,2) = 0"
				...
				Examples are in copymenu.ini
				An invalid, but non-empty, condition always evaluates to False, so the button won't be displayed or will be disabled!
conditionmode<n> :	1 :	The condition shows/hides the button. If the condition is false an empty spot is displayed. Can also be set by condition option -vis.
					2 :	The condition enables/disables the button. If the condition is false a greyed-out button is displayed. Can also be set by condition option -dis.
					0 :	The entire WinButtons windows is re-drawn (giving screen-flicker) if a button-condition changes state. (default)
nobuttonborder<n> :	Sets the Borderless option for this button, if not set by the Global ([Settings] section) or Group parameter nobuttonborder. 
					A borderless button can combine a caption and an image on 1 button, has several layout options like image left, caption right, etc. More info at the description for image<n> 