
simmxtools v16.jan.2017:
	some usefull stuff, usage:
  	-simmxtools -help
		-simmxtools <=will read config.txt
		-simmxtool "keywords", eg: simmxtools "msgbox:'hola'" or simmxtools "run:'cmd /c notepad'\nplacewindow:'notepad',1,2000" <= will wait for notepad start max 2sec
    -try this: simmxtools "msgbox:'hola from simmx tools!'\nmsgbox:'new line'\nrun:'cmd /c notepad'\nshowwindow:'notepad',9,1000\nplacewindow:'notepad',0\nsleep:1400\nplacewindow:'notepad',5\nsleep:1400\nplacewindow:'notepad',1\nsendkeys:'hello{SPACE}from{SPACE}simmx{SPACE}tools!{RETURN}'\nsendkeys:'{RETURN}1234567'\nsendkeys:'{BACK}{BACK}'\nsendkeys:'{SPACE}'\nsendkeys:'6789'\nsendkeys:'{LMENU}'\nsendkeys:'{DOWN}{LEFT}{LEFT}'\nsendkeys:'{UP}{RETURN}'"
  Note1: sendkeys keys info is at the bottom of this file
  Note2: qboxfiledrawers(options tweaker) keywords info are at the bottom of this file
  Note3: qtf explanation in QTF-Format.html, some qtf image names are at the bottom of this file
	
	plug can be created simply with regular dll(named plug_anyname.dll), 2 functions must be defined:
		-INT32 plugInitKeywords(char **ptrtokeywordsnullterm)
		-INT32 plugOnKeyword(DWORD keywind,DWORD numArgs,Pgn pgn,Pgs pgs,Pgr pgr,Psr psr,pluginter &pi)
    If there are clashes from two -same name- keyword in two separate dlls, prog will warn you
	
	known bug:
		-upp version of dll sample crashes, even on simple call PromptOK("str");
    -msgbox:'text ',-16.6,' more text' won't print correct double(just1stPart)
    -comment must be always at begining of a line - not a bug, but still...
  
  
  updates(legend: :modified, +added, *fix/todo):
  	@16.jan.2017:
      Some bug fixes QBox unicode/utf-8 stuff..., qboxedit added insfile/insfiles/fullscreen
      qtfedit added with optional param to open qtf or rtf file - which may be exported to html/rtf, added in demo
      placewindow now has optional params for width/height +width=inPercent,-width=inPixels, same for height, added in demo
  	@23.dec.2016 v0.4qxr:
      Note:3xqbox stuff:qboxfile qboxfileedit qboxfiledrawers, qboxfile is now qboxfiledrawers
      +qboxfile:'textfile.any'(mayBeUtf8)[,number(asqtf,def=0)][,str(title,def="simmxtools")][,str(prependText="")]
      +qboxfileedit:'textfile.any'(mayBeUtf8)	<=simple editor-press f1 for more
    	:qboxfiledrawers:'file'[,number(structAlignment,def=4)] - bug fixed - sample added 'qboxdrawers.txt', just write in some script: qboxfiledrawers:'qboxdrawers.txt' <=change options, then press OK - qboxdrawers.dat should be created - next time it'll be loaded from this
                        note, any compiler can read this byte data struct as long it can define struct->readDatFileIntoIt
                        note, def=4byte alignment, whereas compiler default is usually 8byte alignment(changeCompilerTo4-orModifyThis), as 2ndParm you can modify this
  	@14.dec.2016:
    	:accesing $str1,... some bugs fixed
      +-file param added to simmxtools, use: simmxtools -file somescript.txt or simmxtools -file somescript.smx
      +-args param added to simmxtools, using at end - marks all next args as passed 'arg', access as '$arg1','$arg2' etc, $nclargs as numCmdLineArgs
    	+if/while: string comparision < <= >= >
      +qboxfile:'filename.any' <=for setting options, c-like(pascal,etc-any that can define structs) can access file created as 'filename.dat' struct defined through 'filename.any' - align should be used on struct(for ex.,if you use 4,then you must define data(in 'filename.any') on 4byte boundaries,can use bstr for that. If you want flexibility,align struct(and definitions) on 1byte)
      +setgetwindowmode added "asclassname"
      +sendmessage/postmessage:'wnd',msg,wparam,lparam, $res as result, 'wm_settext',etc(lowercase) can be used for msg parm(chk wm-message-list.txt)
      +processevents	<=sometimes needed
      +setcliptext:'text'
      +strlen:'str' <=$resdbl
			+strcut:'str',start[,num] <=$res
      +getlasterror $res as result
      +getspecialfolder:0-12  res in $res
         0=GetDesktopFolder 1=GetDesktopFolder 2=GetProgramsFolder 3=GetAppDataFolder 4=GetMusicFolder 5=GetPicturesFolder 6=GetVideoFolder
         7=GetPersonalFolder 8=GetTemplatesFolder 9=GetDownloadFolder 10=GetTempFolder 11=GetOsFolder 12=GetSystemFolder 13=GetCurrentFolder
      +showmsgswnd[:0-2]  0=def=show(note:onlyThisIsSuppForNow),1=hideMsgWnd,2=hideMsgWndAndTrayIcon <=that is for wm_messages and scintilla messages(chk wm-message-list.txt)<=all are lowercased before used. Use more or less with 'run:simmxtools "showmsgswnd"' because it blocks. Messages can be added to a list, but make sure names don't 'clash' with original messages
      +getcreatetmpdir	<=create/returns temp dir as $res  <=this is not needed for down cmd, but it can be used as getcreatetmpdir(doing something with it) and then waittmpdir
       getpathnamefromtclikepack:'one of $str vars-tmpdirStoredHere','x:\tcPathFile.(zip,rar,etc)\optionalDirIntoArh\','anyfilesel.anyext'  <=2ndArg is tclikeArchiveFormat(source), 3rdArg is 'selected-file' that'll be returned as FullTempPathName to $res //to stdout
       waittmpdir:'tmpdirretFrom-getcreatetmpdir'  <=will show simple msg and wait(orNoDlgNoWaitIf2ndArg==0), when clicked it'll delete passed arg dircontents(allDirs) - checking if passed argdir is really in 'temp' folder to prevent any damage
  	@10.dec.2016:
		  :$res is used in place of previous $lastres(oldPlugRes/oldRunWait) <=this is thrown out, use $res to acces it
      :if/while - some bugs fixed
      +if - now optionally only leftmost var can be used,eg: if:'$dbl' or if:'$str'
      +break/continue [numNestedLevels=def=1], eg: innermost 'break:3' will break out to 2nd while, where there are 4 nested while's
    	  the best would be to use named while, and specify break/continue to break/continue to - since now if code is later changed/modified,
        break 3(forExample) may go out of sync - for now prog will warn you if you do for example: break 10, where there are only 2 nested while's
        Added tests in config-all.txt
      +$line - to access current line - 1based - as number
      +msgboxtitle keyword eg: msgboxtitle:'title',"regular msgboxtitle has ",&b,' chars'
      *escapes \\, $$ don't work yet, so you can't do this yet,eg: 'text$$idno' or 'text\\nstring', but you can 'text$','idno' and 'text\','nstring'



sendkeys keys:
	"NUMPAD7", 	XK_KP_7,	 	"BACK", 	XK_BackSpace, 
	"NUMPAD8", 	XK_KP_8,		"TAB", 		XK_Tab,
	"NUMPAD9", 	XK_KP_9, 		"RETURN", 	XK_Return,
	"MULTIPLY", XK_KP_Multiply,	"SHIFT",	XK_Shift_Lock,
	"ADD",		XK_KP_Add, 	 	"CONTROL",	XK_Control_L,
	"SEPARATOR", XK_KP_Separator,"MENU", 	XK_Super_L,
	"SUBTRACT", XK_KP_Subtract,	"PAUSE", 	XK_Pause,
	"DECIMAL",	XK_KP_Decimal,	/*"CAPITAL", 	VK_CAPITAL,*/
	"DIVIDE",	XK_KP_Divide,	"ESCAPE",	XK_Escape,
	"F1", 		XK_F1, 			"SPACE", 	XK_KP_Space,
	"F2", 		XK_F2,	 		"END",		XK_End,
	"F3",		XK_F3, 			"HOME",		XK_Home,
	"F4",		XK_F4, 			"LEFT", 	XK_Left,
	"F5",		XK_F5,		 	"UP", 		XK_Up,
	"F6",		XK_F6,		 	"RIGHT",	XK_Right,
	"F7",		XK_F7,		 	"DOWN",		XK_Down,
	"F8",		XK_F8,		 	"PRINT",	XK_Sys_Req,
	"F9",		XK_F9,		 	/*"SNAPSHOT",	VK_SNAPSHOT,*/
	"F10",		XK_F10,		 	"INSERT",	XK_Insert,
	"F11",		XK_F11,		 	"DELETE",	XK_Delete,
	"F12",		XK_F12,		 	"LWIN",		XK_Meta_L,
	"NUMLOCK",	XK_Num_Lock, 	"RWIN",		XK_Meta_R,
	"SCROLL",	XK_Scroll_Lock,	"NUMPAD0",	XK_KP_0,
	"LSHIFT",	XK_Shift_L,	 	"NUMPAD1", 	XK_KP_1,
	"RSHIFT",	XK_Shift_R,	 	"NUMPAD2",	XK_KP_2,
	"LCONTROL",	XK_Control_L, 	"NUMPAD3",	XK_KP_3,
	"RCONTROL",	XK_Control_R, 	"NUMPAD4",	XK_KP_4,
	"LMENU",	XK_Super_L,		"NUMPAD5",	XK_KP_5,
	"RMENU",	XK_Super_R, 	"NUMPAD6",	XK_KP_6,
	"PGUP", 	XK_Page_Up, 	"PGDOWN", 	XK_Page_Down,
	"CAPSLOCK", XK_Caps_Lock, 	"BACKSPACE",XK_BackSpace


qboxfiledrawers:
  note, any compiler can read this byte-dat-file data struct as long as it can define 4byte alignment struct and read-dat-fileIntoIt
  note, def=4byte alignment, whereas compiler default is usually 8byte alignment. With qboxfiledrawers 2ndParm you can modify from def4bytealign to 1byte to really access data as-is - but i am not sure if every compiler supports this - usually c/cpp do
  note, \[ can be used to escape [, ending ] doesn't need(and it can be) escaped character, for ex: \[bstr,8] <-would be printed in string as normal string.
qboxfiledrawers keywords:
  null b=byte w dw qw sb=signedbyte sw sdw sqw flt dbl bstr=bytestr wstr=widestr dwbit wbit bbit si=signint(machDep) ui=unsint(machDep) p(=pointertype) comment getInfoStr ref none
  def=defvalue ft=fromto ls=list(bstr) setwu=setwidthunits(numCharsEditFieldsWidth) dynstr asbool=asboolean asfilesel(use bstr) ascolor(use dw) aseditor(use bstr) asqboxedit(bstr as data)
  asdlgtemplate(useWith aseditor|asqboxedit) readonly editNoChange password2x usrprovidesdata usrsetsdata usrcreatesctrl usrpaints ptr(inStructAs byte*,dword*,etc) askWholeStrDyn
  nocountbytes hide oneIntDown(makeItZeroBasedWhileViewIs1Based) id
  
  (machDep)=machine/architecture 32/64bit dependant - it can be used as a pointer - altough down p is exactly that
  
  Sample: [dw,def,0] this is dword
          [bstr,12,def,'some string']   <=max 12 chars with null terminated char included
          [b,asbool,def,1][bstr,3,hide] <=checkbox, bstr aligns on 4byteBoundary(defaultForThisProg) - for this to work without bstr aligning either(1:use dw instead of b<-shownDown 2:specify 1byteAlignment on qboxfile-andInCompilerIfUsed)
          [dw,asbool,def,1]             <=checkbox - no alignment necessary 4byte=default for this prog
          [bstr,256,asfilesel,setwu,24,def,'']                                       <=file chooser
          [dw,ascolor,def,0x00ee00]                                                  <=color chooser
          [dw,ls,1,2,3,4]                                                            <=list chooser number
          [bstr,6,ls,'one','two','three',def,'two']                                  <=list chooser string
          [dw,ft,2,10]                                                               <=from/to, make in range min-max
          [bstr,256,asdlgtemplate,aseditor]                                          <=qboxedit text editor - max 256-1 chars
          [bstr,34,asdlgtemplate,asqboxedit,def,'[dw,def,2] [bstr,8,def,"astring"]'] <=qboxedit drawers options tweaker
          [dw,ptr,def,2]                                                             <=underneath data is ptrToDword, that's dword*, so it's accessed like that

  This(for now) can only be used in 'compiler' environment:
          [bstr,10,dynstr,asdlgtemplate,aseditor]                      <=dynamic string length editor
          [bstr,10,asfilesel,setwu,24,dynstr,def,'dynamicstrFilename'] <=file chooser with dynamic(unlimited) filename length

  Bits are accessed like so: dwbit while one after the other(sameType),ex: dwbit,1 dwbit,2 dwbit,3 in same dword next dwbit,1 or b,1 starts new bit variable
          Example(using < instead of squareBrackets, so it's a comment):
          Bits: sentence ... byte <b> newDwBit1 <dwbit,1> ...byte <b> newDwBit1 <dwbit,1> sameDwBit2Last <dwbit,2> ...newDwBit1 <dwbit,1> ...sentence.


qtf image names:
  arrow exclamation information question error smallcheck smallup smalldown smallleft smallright spinup3 spinup2 spinup spindown3 spindown2 spindown reporticon smallreporticon
  ibeam0 HandCursor HelpCursor0 HelpCursor1 write open save save_as print new_doc menu_window undo redo select_all cut copy paste_vert paste sort remove menu_check menu_radio
  right_arrow white_right_arrow check white_check left_arrow white_left_arrow cross up_arrow down_arrow plus selection MkDir Dir DirUp File Plus Minus Toggle Diskette Hd CdRom
  Computer Network Share Group Var Home MenuCheck1 MenuCheck0 Empty16x16 MenuRadio0 MenuRadio1 set_transparent wheel_cursor white_wheel_cursor column_cursor swap_color_cursor
  fetch_color fetch_color_cursor tab_wheel hthumb hthumb1 vthumb vthumb1 treeplus tree0 tree1 tree2 treeminus Add Remove SmallDown SmallUp SmallRight SmallLeft go_back go_forward
  font_size help focus_h focus_v checkers SmallDot SmallDotH BigDot BigDotH Bg SortUp SortDown