├── .github └── FUNDING.yml ├── AssoArrays.au3 ├── AutoRun.au3 ├── Autorun.inf ├── GUIScrollbars_Ex.au3 ├── LICENSE └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: lwcorp # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /AssoArrays.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | #include 3 | 4 | ; #INDEX# ======================================================================================================================= 5 | ; Title .........: xHashCollection 6 | ; AutoIt Version : 3.3.4.0 7 | ; Language ......: English 8 | ; Description ...: Create and use Multidimentional Associative arrays 9 | ; Author ........: OHB 10 | ; =============================================================================================================================== 11 | ;~ $tt = TimerInit() 12 | Global $_xHashCollection = ObjCreate( "Scripting.Dictionary" ), $_xHashCache 13 | ;~ ConsoleWrite("Asso Array Load up time: "&Round(TimerDiff($tt) ) & @CRLF) 14 | 15 | ; #FUNCTION# ==================================================================================================================== 16 | ; Name...........: x 17 | ; Description ...: Gets or sets a value in an Associative Array 18 | ; Syntax.........: SET: x( $sKey , $vValue ) 19 | ; GET: x( $key ) 20 | ; Parameters ....: $sKey - the key to set or get. Examples: 21 | ; x( 'foo' ) gets value of foo 22 | ; x( 'foo.bar' ) gets value of bar which is a key of foo 23 | ; $bar = "baz" 24 | ; x( 'foo.$bar' ) gets value of baz which is a key of foo (variables are expanded) 25 | ; Return values .: Success - When setting, return the value set. When getting, returns the requested value. 26 | ; Failure - Returns a 0 27 | ; Author ........: OHB 28 | ; =============================================================================================================================== 29 | Func x( $sKey = '' , $vValue = '' ) 30 | $func = "get" 31 | If @NumParams <> 1 Then $func = "set" 32 | If $sKey == '' Then 33 | If $func == "get" Then 34 | Return $_xHashCollection 35 | Else 36 | $_xHashCollection.removeAll 37 | Return '' 38 | EndIf 39 | EndIf 40 | $parts = StringSplit( $sKey , "." ) 41 | $last_key = $parts[$parts[0]] 42 | $cur = $_xHashCollection 43 | For $x = 1 To $parts[0] - 1 44 | If Not $cur.exists( $parts[$x] ) Then 45 | If $func == "get" Then Return 46 | $cur.add( $parts[$x] , ObjCreate( "Scripting.Dictionary" ) ) 47 | EndIf 48 | $cur = $cur.item( $parts[$x] ) 49 | Next 50 | If IsPtr( $vValue ) Then $vValue = String( $vValue ) 51 | If $func == "get" Then 52 | If Not $cur.exists( $last_key ) Then Return 53 | $item = $cur.item( $last_key ) 54 | Return $item 55 | ElseIf Not $cur.exists( $last_key ) Then 56 | $cur.add( $last_key , $vValue ) 57 | Else 58 | $cur.item( $last_key ) = $vValue 59 | EndIf 60 | Return $vValue 61 | EndFunc 62 | 63 | ; #FUNCTION# ==================================================================================================================== 64 | ; Name...........: x_del 65 | ; Description ...: Removes a key from an Associative Array 66 | ; Syntax.........: x_del( $sKey ) 67 | ; Parameters ....: $sKey - the key to remove. 68 | ; Return values .: Success - True 69 | ; Failure - False 70 | ; Author ........: OHB 71 | ; =============================================================================================================================== 72 | Func x_del( $sKey ) 73 | If $sKey == '' Then Return x( '' , '' ) 74 | $parts = StringSplit( $sKey , "." ) 75 | $cur = $_xHashCollection 76 | For $x = 1 To $parts[0] - 1 77 | If Not $cur.exists( $parts[$x] ) Then Return False 78 | $cur = $cur.item( $parts[$x] ) 79 | If Not IsObj($cur) Then Return False 80 | Next 81 | If Not $cur.exists( $parts[$parts[0]] ) Then Return False 82 | $cur.remove( $parts[$parts[0]] ) 83 | Return True 84 | EndFunc 85 | 86 | ; #FUNCTION# ==================================================================================================================== 87 | ; Name...........: x_display 88 | ; Description ...: Displays the contents of an Associative Array 89 | ; Syntax.........: x_display( $sKey ) 90 | ; Parameters ....: $sKey - the key to display. Examples: 91 | ; x_display() displays everything 92 | ; x_display( 'foo' ) displays the contents of foo 93 | ; Author ........: OHB 94 | ; =============================================================================================================================== 95 | Func x_display( $key = '' ) 96 | $text = $key 97 | If $key <> '' Then $text &= " " 98 | $text &= StringTrimRight( _x_display( x( $key ) , '' ) , 2 ) 99 | ConsoleWrite($text & @LF) 100 | $wHnd = GUICreate( "Array " & $key , 700 , 500 ) 101 | GUISetState( @SW_SHOW , $wHnd ) 102 | $block = GUICtrlCreateEdit( $text , 5 , 5 , 690 , 490 ) 103 | GUICtrlSetFont( $block , 10 , 400 , -1 , 'Courier' ) 104 | While 1 105 | If GUIGetMsg() == -3 Then ExitLoop 106 | WEnd 107 | GUISetState( @SW_HIDE , $wHnd ) 108 | GUIDelete( $wHnd ) 109 | EndFunc 110 | 111 | ; #INTERNAL_USE_ONLY# =========================================================================================================== 112 | ; Name...........: _x_display 113 | ; Description ...: Itterates through an array and builds output for x_display 114 | ; Author ........: OHB 115 | ; =============================================================================================================================== 116 | Func _x_display( $item , $tab ) 117 | If IsObj( $item ) Then 118 | $text = 'Array (' & @CRLF 119 | $itemAdded = False 120 | For $i In $item 121 | $text &= $tab & " [" & $i & "] => " & _x_display( $item.item($i) , $tab & " " ) 122 | $itemAdded = True 123 | Next 124 | If Not $itemAdded Then $text &= @CRLF 125 | $text &= $tab & ')' 126 | ElseIf IsArray( $item ) Then 127 | $text = "Array" 128 | $totalItems = 1 129 | $dimensions = UBound( $item , 0 ) 130 | For $dimension = 1 To $dimensions 131 | $size = UBound( $item , $dimension ) 132 | $totalItems *= $size 133 | $text &= "[" & $size & "]" 134 | Next 135 | $text &= " (" & @CRLF 136 | For $itemID = 0 To $totalItems - 1 137 | $idName = '' 138 | $idNum = $itemID 139 | For $dimension = 1 To $dimensions - 1 140 | $mul = ( $totalItems / UBound( $item , $dimension ) ) 141 | $a = Floor( $idNum / $mul ) 142 | $idName &= '[' & $a & ']' 143 | $idNum -= ( $a * $mul ) 144 | Next 145 | $idName &= '[' & $idNum & ']' 146 | $text &= $tab & " " & $idName & " => " & _x_display( Execute( "$item" & $idName ) , $tab & " " ) 147 | Next 148 | $text &= $tab & ")" 149 | Else 150 | $text = $item 151 | EndIf 152 | $text &= @CRLF 153 | Return $text 154 | EndFunc 155 | 156 | 157 | ; Name...........: x_count 158 | ; Description ...: Returns a count of items 159 | ; Syntax.........: x_count( $sKey ) 160 | ; Parameters ....: $sKey - the key 161 | ; Return values .: Success: count of items of a provided key 162 | ; x_count() returns count os keys on first level 163 | ; Failure: 0, set error to: 164 | ; -1 = the key is not an object, but an item with a value 165 | ; -2 = the key does not exist 166 | ; Author ........: shEiD (original "x" UDF by: OHB) 167 | Func x_count($sKey = '') 168 | If $sKey == '' Then Return $_xHashCollection.Count 169 | Local $cur = $_xHashCollection 170 | Local $parts = StringSplit($sKey, ".") 171 | For $x = 1 To $parts[0] 172 | If Not $cur.exists($parts[$x]) Then Return SetError(-2, 0, 0) 173 | $cur = $cur.item($parts[$x]) 174 | Next 175 | If Not IsObj($cur) Then SetError(-1, 0, 0) 176 | Return $cur.Count 177 | EndFunc ;==>x_count 178 | 179 | 180 | ; Author: MilesAhead 181 | ; http://www.autoitscript.com/forum/topic/110768-itaskbarlist3/page__view__findpost__p__910631 182 | ;write AssocArray to IniFile Section 183 | ;returns 1 on success - sets @error on failure 184 | Func _WriteAssocToIni($myIni = 'config.ini', $mySection = '', $bEraseAll = false, $sSep = "|") 185 | If Not StringInStr($myIni,".") Then $myIni &= ".ini" 186 | 187 | If $bEraseAll then 188 | $temp = FileOpen($myIni, 2) 189 | FileClose($temp) 190 | EndIf 191 | 192 | Local $sIni = StringLeft($myIni,StringInStr($myIni,".")-1) 193 | 194 | If Not $_xHashCollection.Exists($sIni) Then Return SetError(-1, 0, 0) 195 | 196 | If $mySection == '' Then 197 | $aSection = $_xHashCollection($sIni).Keys(); All sections 198 | Else 199 | Dim $aSection[1] = [$mySection]; specific Section 200 | EndIf 201 | Local $retVal = 0 202 | For $i = 0 To UBound($aSection)-1 203 | $cur = x($sIni&"."&$aSection[$i]) 204 | $retVal = 0 205 | If $cur.Count() < 1 Then 206 | Return SetError(-2, 0, 0) 207 | EndIf 208 | Local $iArray[$cur.Count()][2] 209 | Local $aArray = $cur.Keys() 210 | For $x = 0 To UBound($aArray) - 1 211 | $iArray[$x][0] = $aArray[$x] 212 | $value = x($sIni&"."&$aSection[$i]&"."&$aArray[$x]) 213 | If IsArray($value) then 214 | $iArray[$x][1] = _MakePosString($value, $sSep) 215 | Else 216 | $iArray[$x][1] = $value 217 | EndIf 218 | Next 219 | $retVal = IniWriteSection($myIni, $aSection[$i], $iArray, 0) 220 | next 221 | 222 | Return SetError(@error, 0, $retVal) 223 | EndFunc ;==>_WriteAssocToIni 224 | 225 | ;read AssocArray from IniFile Section 226 | ;returns number of items read - sets @error on failure 227 | Func _ReadAssocFromIni($myIni = 'config.ini', $mySection = '', $sSep = "|") 228 | If Not StringInStr($myIni,".") Then $myIni &= ".ini" 229 | Local $sIni = StringLeft($myIni,StringInStr($myIni,".")-1) 230 | 231 | If $mySection == '' Then 232 | $aSection = IniReadSectionNames ($myIni); All sections 233 | If @error Then Return SetError(@error, 0, 0) 234 | Else 235 | Dim $aSection[2] = [1,$mySection]; specific Section 236 | EndIf 237 | 238 | For $i = 1 To UBound($aSection)-1 239 | 240 | Local $sectionArray = IniReadSection($myIni, $aSection[$i]) 241 | If @error Then Return SetError(-1, 0, 0) 242 | For $x = 1 To $sectionArray[0][0] 243 | If StringInStr($sectionArray[$x][1], $sSep) then 244 | $posS = _MakePosArray($sectionArray[$x][1], $sSep) 245 | Else 246 | $posS = $sectionArray[$x][1] 247 | EndIf 248 | x($sIni&"."&$aSection[$i]&"."&$sectionArray[$x][0], $posS) 249 | Next 250 | 251 | next 252 | Return $sectionArray[0][0] 253 | EndFunc ;==>_ReadAssocFromIni 254 | 255 | ;makes a Position string using '#' number separator 256 | Func _MakePosString($posArray, $sSep = "|") 257 | Local $str = "" 258 | For $x = 0 To UBound($posArray) - 2 259 | $str &= String($posArray[$x]) & $sSep 260 | Next 261 | $str &= String($posArray[UBound($posArray) - 1]) 262 | Return $str 263 | EndFunc ;==>_MakePosString 264 | 265 | ;makes a Position array from a Position string 266 | Func _MakePosArray($posString, $sSep = "|") 267 | Return StringSplit($posString, $sSep, 2) 268 | EndFunc ;==>_MakePosArray 269 | -------------------------------------------------------------------------------- /Autorun.inf: -------------------------------------------------------------------------------- 1 | [AutoRun] 2 | open=AutoRun.exe 3 | icon=AutoRun.exe, 0 4 | ;The ", 0 " above, tells Windows to use the icon embedded in AutoRun.exe. 5 | ;If you do not want any icon in My Computer, put a semicolon in front of the icon line. 6 | ;If using your own icon file, use this line instead- 7 | ;icon=icon.ico 8 | 9 | [CUSTOM MENU] 10 | ;hidetrayicon=1 ;uncomment to hide 11 | ;skiptobutton=3 12 | ;clickbutton=3 13 | ;kiosk=1 14 | ;theme= ; dark/light - leave commented out for auto detection 15 | ;fontface=helvetica 16 | ;fontsize=10 17 | ;textcolor=orange 18 | ;buttoncolor=#fefee0 19 | ;menucolor=white 20 | ;buttonwidth=470 ; comment out to make it automatic 21 | ;buttonheight=50 22 | ;titletext=AutoRun LWMenu 23 | ;button_browse= ;blocked/hidden/minimized/maximized 24 | ;button_edit= ;blocked/hidden/minimized/maximized 25 | ;button_close= ;blocked/hidden 26 | ;maxbuttons=5 ;limit number of buttons 27 | ;Everything after a semicolon is ignored by the program. 28 | ;Text inside brackets is case sensitive, use Uppercase. 29 | ;Text on left side of "=" is case sensitive, use lowercase. 30 | ;Your text can be mixed case. 31 | 32 | ;The following can be used both globally or for individual buttons: 33 | ;use simulate=1 to not actually run, create and delete anything, but to just simulate it 34 | ;use singlerun=1 to suggest launching the filename just once 35 | ;use singleclick=1 to prevent clicking already clicked buttons 36 | ;use admin=1 to launch programs as an administrator 37 | ;use blinktaskbarwhendone=1 to blink the taskbar upon completion of the launched program 38 | ;use focusbutton=X (e.g. focusbutton=3) to make the menu focus on that specific button 39 | ;use netaccess=0 or netaccess=1 to block/allow Windows Firewall net access for the launched program 40 | ;use setenv= define temporary environment variable|value (e.g. APPDATA|alt_path or APPDATA|alt_path| to auto expand to an absolute folder) - can have multiple lines of entries 41 | ;use closemenuonclick=1 to close the menu after a launch 42 | ;use hidefrommenu=1 to hide a button from the menu - preferably used when meant to run only through buttonafter 43 | ;use show= for a blocked/hidden/minimized/maximized launch 44 | 45 | ;The following is only for invidiual buttons: 46 | ;the relativepathandfilename path names do NOT need quotes around them if they contain spaces. 47 | ;to pass parameters to exe files, use optionalcommandlineparams=, otherwise leave blank. 48 | ;use programpath= to define an alternative starting folder than the launched program's one 49 | ;use registry= to delete registry keys after the program exists or create(+) them before launching it - you can also create basic entries like +HKCU\Software\Test,accept,1 50 | ;use deletefolders= to delete folders after the program exists or create(+) them before launching it 51 | ;use deletefiles= to delete files after the program exits or create(+) them before launching it 52 | ;use backuppath= to keep a backup of registry/folders/files to restore before launching the program. Use . for current folder but preferably a standalone folder to avoid clashes 53 | ;use buttonafter= to run another button (e.g. 4) after a previous button 54 | ;use symlink= create this folder/path as a symlink|target to another folder/file (e.g. %appdata%\program\|c:\program) - can have multiple lines of entries 55 | ;use service= delete a service after the program exists and/or create it before launching it. Use just Name to delete, and Name|Display Name|PathName|StartMode|DesktopInteract to create (e.g. CMD | CMD Testing | %comspec% | Manual | false) - can have multiple lines of entries 56 | ;use drivers= delete drivers after the program exits by their Device Manager names (e.g. "Microsoft AC Adapter" "Microsoft Print to PDF") 57 | 58 | [BUTTON1] 59 | buttontext=Dummy 60 | relativepathandfilename= ; can be relative. Blank means it would display as a dummy button 61 | optionalcommandlineparams= 62 | closemenuonclick=1 63 | ;programpath= ; can be relative 64 | ;registry= ; use a + prefix to create a value before launching the program 65 | ;deletefolders=; can be relative. Use a + prefix to create a folder before launching the program 66 | ;deletefiles=; can be relative 67 | ;show=; blocked/hidden/minimized/maximized - how should the program be launched 68 | 69 | [BUTTON2] 70 | buttontext=Google 71 | relativepathandfilename=https://www.google.com 72 | optionalcommandlineparams= 73 | closemenuonclick=1 74 | 75 | [BUTTON3] 76 | buttontext=CMD (then blinking and focusing on next button) 77 | relativepathandfilename=cmd ; would try to launch through the OS path 78 | optionalcommandlineparams= 79 | closemenuonclick=0 80 | focusbutton=4 81 | blinktaskbarwhendone=1 82 | admin=1 83 | 84 | [BUTTON4] 85 | buttontext=Test net access before and after net blocking 86 | relativepathandfilename=%windir%\system32\nslookup.exe 87 | optionalcommandlineparams= 88 | closemenuonclick=1 89 | buttonafter=5 90 | 91 | [BUTTON5] 92 | buttontext=Test net access after net blocking 93 | relativepathandfilename=%windir%\system32\nslookup.exe 94 | optionalcommandlineparams= 95 | closemenuonclick=1 96 | netaccess=0 97 | hidefrommenu=1 98 | 99 | [BUTTON6] 100 | buttontext=Notepad plus symlink 101 | relativepathandfilename=%windir%\notepad.exe 102 | optionalcommandlineparams= 103 | closemenuonclick=1 104 | backuppath=. 105 | singlerun=1 106 | symlink=%appdata%\notepad1\ | appdata1 107 | symlink=%appdata%\notepad2\|appdata2 108 | symlink=%appdata%\notepad3\|appdata3 109 | 110 | [BUTTON7] 111 | buttontext=Program with leftovers 112 | relativepathandfilename=program ; would try to launch through the OS path 113 | optionalcommandlineparams= 114 | closemenuonclick=1 115 | registry=HKCU\Software\advanced +HKCU\Software\advanced,accept,1 116 | deletefolders=data +dataempty 117 | deletefiles=+program.tmp 118 | simulate=1 119 | 120 | [BUTTON8] 121 | buttontext=Space Quest 3D (Unity Engine) 122 | relativepathandfilename=%USERPROFILE%\Documents\games\Space Quest 3D\Space Quest 3D.exe 123 | optionalcommandlineparams= 124 | closemenuonclick=1 125 | registry="+HKCU\SOFTWARE\Turbo Chimp" 126 | deletefolders="+%USERPROFILE%\AppData\LocalLow\Turbo Chimp" "+%USERPROFILE%\Documents\Turbo Chimp" 127 | backuppath=. 128 | simulate=1 129 | 130 | [BUTTON9] 131 | buttontext=Subfolder / sub-menu (if it has autorun.inf) 132 | relativepathandfilename=subfolder 133 | optionalcommandlineparams= 134 | closemenuonclick=1 135 | -------------------------------------------------------------------------------- /GUIScrollbars_Ex.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | ; #INDEX# ============================================================================================================ 4 | ; Title .........: GUIScrollBars_Ex 5 | ; AutoIt Version : v3.3.6.0 6 | ; Language ......: English 7 | ; Description ...: Generates scrollbars for user defined sizes of GUI and aperture and sets proportional thumb sizes 8 | ; Remarks .......: 9 | ; Note ..........: 10 | ; Author(s) .....: Melba23 - with some code based on the WinAPI and GUIScrollBars includes 11 | ; and contributions from rover, czardas, MrCreatoR, Malkey and KaFu 12 | ; ==================================================================================================================== 13 | 14 | ;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 15 | 16 | ; #INCLUDES# ========================================================================================================= 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | ; #GLOBAL VARIABLES# ================================================================================================= 25 | Global $__g_aSB_WindowInfo[1][10] = [[0, 0, 0, 0, -1]] 26 | ; [0][0] = Count of initiated GUIs [n][0] = Handle to window 27 | ; [0][1] = Resizing horz position [n][1] = Not used 28 | ; [0][2] = Resizing vert position [n][2] = Average horizontal pixels per char 29 | ; [0][3] = Resizing GUI handle [n][3] = Vertical pixels per char 30 | ; [0][4] = Resizing GUI index [n][4] = Client area width 31 | ; [0][5] = Width of VScrollbar [n][5] = Client area height 32 | ; [0][6] = Height of HScrollbar [n][6] = Horizontal max setting 33 | ; [0][7] = Non-minimized event flag [n][7] = Vertical max setting 34 | ; [n][8] = Vertical scrollbar position for minimize/restore 35 | ; [n][9] = Horizontal scrollbar position for minimize/restore 36 | $__g_aSB_WindowInfo[0][5] = _WinAPI_GetSystemMetrics(2) ; Width of VScrollbar: SM_CXVSCROLL 37 | $__g_aSB_WindowInfo[0][6] = _WinAPI_GetSystemMetrics(3) ; Height of HScrollbar: SM_CYHSCROLL 38 | Global $__g_aSB_WindowInfoEx[1][11] 39 | ; [n][0] = Horizontal scrollable size 40 | ; [n][1] = Vertical scrollable size 41 | ; [n][2] = Width correction factor 42 | ; [n][3] = Height correction factor 43 | ; [n][4] = Before/After flag 44 | ; [n][5] = Key repeat value 45 | ; [n][6] = Wheel scroll value 46 | ; [n][7] = Max horz scroll size if resizeable 47 | ; [n][8] = Max vert scroll size if resizeable 48 | ; [n][9] = Minimized flag 49 | 50 | ; #CURRENT# ========================================================================================================== 51 | ; _GUIScrollbars_Generate: Generates scrollbars for a GUI with a defined aperture and registers required handlers 52 | ; _GUIScrollbars_ReSizer: Registers required handlers and optionally creates GUI at max scrollable size 53 | ; _GUIScrollbars_Locate_Ctrl: Calculates coordinates to use to position controls after scrollbar creation 54 | ; _GUIScrollbars_Scroll_Page: Scrolls to min, max or page number 55 | ; _GUIScrollbars_EventMonitor: Save and restores scrollbar positions on GUI minimize/restore 56 | ; ==================================================================================================================== 57 | 58 | ; #INTERNAL_USE_ONLY#================================================================================================= 59 | ; __Scrollbars_WM_VSCROLL: Handler for vertical scrollbar 60 | ; __Scrollbars_WM_HSCROLL: Handler for horizontal scrollbar 61 | ; __Scrollbars_WM_MOUSEWHEEL: Handler for vertical mouse wheel scroll 62 | ; __Scrollbars_WM_MOUSEHWHEEL: Handler for horizontal mouse wheel scroll 63 | ; __Scrollbars_WM_KEYUP: Handler for scrolling on cursor, pageup/down, home and end key press 64 | ; __Scrollbars_WM_ENTERSIZEMOVE: Handler for detecting when GUI resizing is started 65 | ; __Scrollbars_WM_EXITSIZEMOVE: Handler for detecting when GUI resizing is complete 66 | ; __Scrollbars_WM_SIZE: Handler for detecting when GUI enters/exits minimized state 67 | ;===================================================================================================================== 68 | 69 | ; #FUNCTION# ========================================================================================================= 70 | ; Name...........: _GUIScrollbars_Generate 71 | ; Description ...: Generates scrollbars for a GUI with a defined aperture with proportional thumb sizes 72 | ; Syntax.........: _GUIScrollbars_Generate ($hWnd, $iH_Scroll = 0, [$iV_Scroll = 0, [$iH_Tight = 0, [$iV_Tight = 0, [$fBefore = False, [$iRepeat = 0 [, $bRegisterMsg = True]]]]]]) 73 | ; Parameters ....: $hWnd -> GUI to contain scrollbars 74 | ; $iH_Scroll -> Width in pixels of area to be scrolled 75 | ; $iV_Scroll -> Height in pixels of area to be scrolled (default = 0) 76 | ; $iH_Tight -> 1 = Adjust mean position of right edge of scrolled area to right (default = 0) 77 | ; $iV_Tight -> 1 = Adjust mean position of bottom edge of scrolled area down (default = 0) 78 | ; $fBefore -> True = Scrollbars are being generated BEFORE controls 79 | ; False = Scrollbars are being generated AFTER controls (default) - key scrolling possible 80 | ; $iRepeat -> Number of lines/chars moved by a single cursor key press - default 0 81 | ; $bRegisterMsg -> True (default) = register WM_VSCROLL, WM_HSCROLL, WM_MOUSEWHEEL, WM_MOUSEHWHEEL & WM_KEYUP handlers 82 | ; False = do not register handlers 83 | ; Requirement(s).: v3.3.6.0 or higher 84 | ; Return values .: Success - Returns a 4-element array (see remarks for details): 85 | ; [0] = Actual aperture width ; [1] = Actual aperture height] 86 | ; [2] = Width correction factor ; [3] = Height correction factor] 87 | ; Failure - Returns either 0 (UDF error) or negative integer (API error) 88 | ; If UDF error then @error set as follows: 89 | ; 1 - hWnd not a valid handle 90 | ; 2 - No scroll size parameters 91 | ; 3 - Scrollbar creation or parameter setting failure 92 | ; If API error then @error and @extended as set by API error. Return values: 93 | ; -1 - GetDC failure 94 | ; -2 - GetTextMetricsW failure 95 | ; -3 - GetClientRect failure 96 | ; Remarks .......; - The $fBefore parameter is needed because of the way Windows deals with scrollbars. When the 97 | ; scrollbars are generated, the visible part of the scrollable GUI resizes to fit the in the 98 | ; remaining (smaller) client area. 99 | ; - If the scrollbars are generated BEFORE any controls, the UDF should be called with the 100 | ; $fBefore parameter set. The new client size of the aperture window is returned so that 101 | ; controls can then be created using these values. 102 | ; - If controls have been created before the scrollbars are generated then the UDF should be 103 | ; called without the $fBefore parameter. The correction factors returned can then be applied to 104 | ; any subsequent control positioning and sizing. This is necessary because of the positions and 105 | ; sizes of existing controls will be slightly altered as the scrollbars are generated and the GUI 106 | ; resized. Any controls created subsequently would therefore be slightly misplaced in relation 107 | ; to the existing ones unless the correction factors are used when positoning and sizing them. 108 | ; - If existing controls were fixed in place using GUICtrlResizing($GUI_DOCKALL) there is no need 109 | ; to apply the correction factors as the controls will not have moved with the GUI resizing. 110 | ; - If a value is set for $iRepeat then the UDF will register the WM_KEYUP message to allow scrolling 111 | ; with the cursor, pageup/down, home and end keys. Note that in this case any controls must be created 112 | ; after the GUISetState(@SW_SHOW) line or the key scrolling will not be activated 113 | ; - If there are existing message handlers for the WM_SIZE, WM_VSCROLL, WM_HSCROLL, WM_MOUSEWHEEL, WM_MOUSEHWHEEL & WM_KEYUP 114 | ; messages then $bMessageReg must be set to False and the relevant handler function(s) added to these handlers 115 | ; or registered separately 116 | ; Author ........: Melba23 - with some code based on the WinAPI and GUIScrollBars includes 117 | ; Example........; Yes 118 | ;===================================================================================================================== 119 | Func _GUIScrollbars_Generate($hWnd, $iH_Scroll = 0, $iV_Scroll = 0, $iH_Tight = 0, $iV_Tight = 0, $fBefore = False, $iRepeat = 0, $bRegisterMsg = True) 120 | 121 | Local $iIndex 122 | 123 | ; Check if valid window handle 124 | If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) 125 | 126 | ; Search for existing GUI 127 | For $iIndex = 1 To $__g_aSB_WindowInfo[0][0] 128 | If $hWnd = $__g_aSB_WindowInfo[$iIndex][0] Then 129 | ExitLoop 130 | EndIf 131 | Next 132 | 133 | If $iIndex > $__g_aSB_WindowInfo[0][0] Then 134 | $__g_aSB_WindowInfo[0][0] += 1 135 | ReDim $__g_aSB_WindowInfo[$iIndex + 1][UBound($__g_aSB_WindowInfo, 2)] 136 | ReDim $__g_aSB_WindowInfoEx[$iIndex + 1][UBound($__g_aSB_WindowInfoEx, 2)] 137 | EndIf 138 | 139 | ; If no scroll sizes set, return error 140 | If $iH_Scroll = 0 And $iV_Scroll = 0 Then Return SetError(2, 0, 0) 141 | 142 | ; Confirm Tight values 143 | If $iH_Tight <> 0 Then $iH_Tight = 1 144 | If $iV_Tight <> 0 Then $iV_Tight = 1 145 | 146 | ; Check Repeat value 147 | If Not IsInt($iRepeat) Then $iRepeat = 0 148 | 149 | ; Create structs 150 | Local $tTEXTMETRIC = DllStructCreate($tagTEXTMETRIC) 151 | Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO) 152 | DllStructSetData($tSCROLLINFO, "cbSize", DllStructGetSize($tSCROLLINFO)) 153 | ;Local $tRect = DllStructCreate($tagRECT) 154 | 155 | ; Declare local variables 156 | Local $iError, $iExtended 157 | 158 | ; Save window handle 159 | $__g_aSB_WindowInfo[$iIndex][0] = $hWnd 160 | 161 | ; Save scrollbar visible state 162 | Local $aVis[2] = [(($iH_Scroll = 0) ? (False) : (True)), (($iV_Scroll = 0) ? (False) : (True))] 163 | $__g_aSB_WindowInfo[$iIndex][1] = $aVis 164 | 165 | ; Determine text size 166 | Local $hDC = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hWnd) 167 | If Not @error Then 168 | $hDC = $hDC[0] 169 | DllCall("gdi32.dll", "bool", "GetTextMetricsW", "handle", $hDC, "ptr", DllStructGetPtr($tTEXTMETRIC)) 170 | If @error Then 171 | $iError = @error 172 | $iExtended = @extended 173 | DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC) 174 | Return SetError($iError, $iExtended, -2) 175 | EndIf 176 | DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC) 177 | Else 178 | Return SetError(@error, @extended, -1) 179 | EndIf 180 | $__g_aSB_WindowInfo[$iIndex][2] = DllStructGetData($tTEXTMETRIC, "tmAveCharWidth") 181 | $__g_aSB_WindowInfo[$iIndex][3] = DllStructGetData($tTEXTMETRIC, "tmHeight") + DllStructGetData($tTEXTMETRIC, "tmExternalLeading") 182 | 183 | ; Size aperture window without bars 184 | Local $aClientSize = WinGetClientSize($hWnd) 185 | Local $iX_Client_Full = $aClientSize[0] 186 | Local $iY_Client_Full = $aClientSize[1] 187 | $__g_aSB_WindowInfo[$iIndex][4] = $iX_Client_Full 188 | $__g_aSB_WindowInfo[$iIndex][5] = $iY_Client_Full 189 | 190 | ; Is GUI already larger then max scroll size 191 | If $iX_Client_Full > $iH_Scroll Then $iH_Scroll = 0 192 | If $iY_Client_Full > $iV_Scroll Then $iV_Scroll = 0 193 | 194 | ; Hide both scrollbars 195 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) 196 | ; Show scrollbars and register scrollbar and mousewheel messages if required 197 | If $iH_Scroll Then 198 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ) 199 | If $bRegisterMsg Then 200 | GUIRegisterMsg($WM_HSCROLL, "__Scrollbars_WM_HSCROLL") 201 | GUIRegisterMsg($WM_MOUSEHWHEEL, '__Scrollbars_WM_MOUSEHWHEEL') 202 | EndIf 203 | EndIf 204 | If $iV_Scroll Then 205 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT) 206 | If $bRegisterMsg Then 207 | GUIRegisterMsg($WM_VSCROLL, "__Scrollbars_WM_VSCROLL") 208 | GUIRegisterMsg($WM_MOUSEWHEEL, "__Scrollbars_WM_MOUSEWHEEL") 209 | EndIf 210 | EndIf 211 | ; Only register for key scrolling if required 212 | If $iRepeat And $bRegisterMsg Then 213 | GUIRegisterMsg($WM_KEYUP, "__Scrollbars_WM_KEYUP") 214 | EndIf 215 | ; Check for GUI being minimized by Win-D or taskbar "show desktop" button 216 | If $bRegisterMsg Then 217 | GUIRegisterMsg($WM_SIZE, "__Scrollbars_WM_SIZE") 218 | EndIf 219 | 220 | ; Size aperture window with bars 221 | $aClientSize = WinGetClientSize($hWnd) 222 | Local $iX_Client_Bar = $aClientSize[0] 223 | Local $iY_Client_Bar = $aClientSize[1] 224 | 225 | ; If horizontal scrollbar is required 226 | Local $iH_FullPage 227 | If $iH_Scroll Then 228 | If $fBefore Then 229 | ; Use actual aperture width 230 | $__g_aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar 231 | ; Determine page size (aperture width / text width) 232 | $iH_FullPage = Floor($__g_aSB_WindowInfo[$iIndex][4] / $__g_aSB_WindowInfo[$iIndex][2]) 233 | ; Determine max size (scroll width / text width - tight) 234 | $__g_aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $__g_aSB_WindowInfo[$iIndex][2]) - $iH_Tight 235 | Else 236 | ; Use reduced aperture width only if other scrollbar exists 237 | If $iV_Scroll Then $__g_aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar 238 | ; Determine page size (aperture width / text width) 239 | $iH_FullPage = Floor($__g_aSB_WindowInfo[$iIndex][4] / $__g_aSB_WindowInfo[$iIndex][2]) 240 | ; Determine max size (scroll width / text width * correction factor for V scrollbar if required - tight) 241 | $__g_aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $__g_aSB_WindowInfo[$iIndex][2] * $__g_aSB_WindowInfo[$iIndex][4] / $iX_Client_Full) - $iH_Tight 242 | EndIf 243 | Else 244 | $__g_aSB_WindowInfo[$iIndex][6] = 0 245 | EndIf 246 | 247 | ; If vertical scrollbar required 248 | Local $iV_FullPage 249 | If $iV_Scroll Then 250 | If $fBefore Then 251 | ; Use actual aperture height 252 | $__g_aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar 253 | ; Determine page size (aperture width / text width) 254 | $iV_FullPage = Floor($__g_aSB_WindowInfo[$iIndex][5] / $__g_aSB_WindowInfo[$iIndex][3]) 255 | ; Determine max size (scroll width / text width - tight) 256 | $__g_aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $__g_aSB_WindowInfo[$iIndex][3]) - $iV_Tight 257 | Else 258 | ; Use reduced aperture width only if other scrollbar exists 259 | If $iH_Scroll Then $__g_aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar 260 | ; Determine page size (aperture width / text width) 261 | $iV_FullPage = Floor($__g_aSB_WindowInfo[$iIndex][5] / $__g_aSB_WindowInfo[$iIndex][3]) 262 | ; Determine max size (scroll width / text width * correction factor for H scrollbar if required - tight) 263 | $__g_aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $__g_aSB_WindowInfo[$iIndex][3] * $__g_aSB_WindowInfo[$iIndex][5] / $iY_Client_Full) - $iV_Tight 264 | EndIf 265 | Else 266 | $__g_aSB_WindowInfo[$iIndex][7] = 0 267 | EndIf 268 | 269 | Local $aRet[4] 270 | If $iV_Scroll Then 271 | $aRet[0] = $iX_Client_Bar 272 | Else 273 | $aRet[0] = $iX_Client_Full 274 | EndIf 275 | If $iH_Scroll Then 276 | $aRet[1] = $iY_Client_Bar 277 | Else 278 | $aRet[1] = $iY_Client_Full 279 | EndIf 280 | $aRet[2] = $iX_Client_Bar / $iX_Client_Full 281 | $aRet[3] = $iY_Client_Bar / $iY_Client_Full 282 | 283 | ; Save extended window info 284 | $__g_aSB_WindowInfoEx[$iIndex][0] = $iH_Scroll 285 | $__g_aSB_WindowInfoEx[$iIndex][1] = $iV_Scroll 286 | $__g_aSB_WindowInfoEx[$iIndex][2] = $aRet[2] 287 | $__g_aSB_WindowInfoEx[$iIndex][3] = $aRet[3] 288 | $__g_aSB_WindowInfoEx[$iIndex][4] = $fBefore 289 | $__g_aSB_WindowInfoEx[$iIndex][5] = $iRepeat 290 | $__g_aSB_WindowInfoEx[$iIndex][6] = (($iRepeat) ? ($iRepeat) : (7)) ; Set default 7 for mousewheel if no keys registered 291 | 292 | Local $fSuccess = True 293 | If _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) = False Then $fSuccess = False 294 | If $iH_Scroll Then 295 | If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_HORZ, $__g_aSB_WindowInfo[$iIndex][6]) = False Then $fSuccess = False 296 | _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_HORZ, $iH_FullPage) 297 | If @error Then $fSuccess = False 298 | If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, True) = False Then $fSuccess = False 299 | Else 300 | If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False) = False Then $fSuccess = False 301 | EndIf 302 | If $iV_Scroll Then 303 | If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_VERT, $__g_aSB_WindowInfo[$iIndex][7]) = False Then $fSuccess = False 304 | _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_VERT, $iV_FullPage) 305 | If @error Then $fSuccess = False 306 | If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, True) = False Then $fSuccess = False 307 | Else 308 | If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, False) = False Then $fSuccess = False 309 | EndIf 310 | 311 | If $fSuccess Then Return $aRet 312 | Return SetError(3, 0, 0) 313 | 314 | EndFunc ;==>_GUIScrollbars_Generate 315 | 316 | ; #FUNCTION# ========================================================================================================= 317 | ; Name...........: _GUIScrollbars_ReSizer 318 | ; Description ...: Registers required handlers and optionally creates GUI at max scrollable size 319 | ; Syntax.........: _GUIScrollbars_ReSizer ($hWnd, $iH_Max, $iV_Max, [, $bFullClient = False [, $bRegisterMsg = True]]) 320 | ; Parameters ....: $hWnd -> Resizable GUI 321 | ; $iH_Max -> Max width where scrollbars needed 322 | ; $iV_Max -> Max height where scrollbars needed 323 | ; $bFullClient -> False (default) - GUI remains at created size and scrollbars shown if required 324 | ; True - GUI resized to maximum client area where scrollbars not required 325 | ; $bRegisterMsg -> True (default) - Register WM_ENTER/EXITSIZEMOVE handlers 326 | ; False - Do not register handlers 327 | ; Requirement(s).: v3.3.6.0 or higher 328 | ; Return values .: Success - An array holding width and height of GUI when scrollbars not needed 329 | ; Failure - Returns 0 with @error set as follows: 330 | ; 1 - Invalid window handle 331 | ; 2 - GUI not initiated 332 | ; 3 - GUI not resizable 333 | ; Remarks .......; - Resizable GUIs have slightly smaller client areas than defined in GUICreate because of their 334 | ; thicker borders - setting $bFullClient to True resizes the GUI client area to the correct size 335 | ; - As this function resizes the GUI, it should be run BEFORE making the GUI visible 336 | ; - If there are existing message handlers for the WM_ENTER/EXITSIZEMOVE messages then 337 | ; $bMessageReg should be set to False and the relevant handler function(s) added to these handler(s) 338 | ; or registered separately 339 | ; - The returned array can be used in a WM_GETMINMAXINFO handler to prevent GUI being oversized 340 | ; Author ........: Melba23 341 | ; Example........; Yes 342 | ;===================================================================================================================== 343 | Func _GUIScrollbars_ReSizer($hWnd, $iH_Max, $iV_Max, $bFullClient = False, $bRegisterMsg = True) 344 | 345 | ; Check $hWnd 346 | If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) 347 | 348 | ; Search for existing GUI 349 | For $iIndex = 1 To $__g_aSB_WindowInfo[0][0] 350 | If $hWnd = $__g_aSB_WindowInfo[$iIndex][0] Then 351 | ExitLoop 352 | EndIf 353 | Next 354 | If $iIndex > $__g_aSB_WindowInfo[0][0] Then Return SetError(2, 0, 0) 355 | 356 | ; Check GUI resizable 357 | If Not BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), 0x00040000) Then Return SetError(3, 0, 0) 358 | 359 | ; Set max scrollable sizes 360 | $__g_aSB_WindowInfoEx[$iIndex][7] = $iH_Max 361 | $__g_aSB_WindowInfoEx[$iIndex][8] = $iV_Max 362 | 363 | ; Get current GUI size 364 | Local $aPos = WinGetPos($hWnd) 365 | ; Resize GUI to max scrollable size 366 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) 367 | Local $aClientSize = WinGetClientSize($hWnd) 368 | ; Resize GUI to set correct client area for max size 369 | Local $aMaxSize[2] = [$aPos[2] + $__g_aSB_WindowInfoEx[$iIndex][7] - $aClientSize[0], $aPos[3] + $__g_aSB_WindowInfoEx[$iIndex][8] - $aClientSize[1]] 370 | WinMove($hWnd, "", Default, Default, $aMaxSize[0], $aMaxSize[1]) 371 | 372 | ; Is GUI to be resized to original size 373 | If Not $bFullClient Then 374 | ; Set scroll values 375 | $__g_aSB_WindowInfo[0][1] = 0 376 | $__g_aSB_WindowInfo[0][2] = 0 377 | ; Resize GUI 378 | WinMove($hWnd, "", Default, Default, $aPos[2], $aPos[3]) 379 | ; Adjust Scrollbars 380 | $__g_aSB_WindowInfo[0][3] = $hWnd 381 | $__g_aSB_WindowInfo[0][4] = $iIndex 382 | __Scrollbars_WM_EXITSIZEMOVE($hWnd, 0, 0, 0) 383 | EndIf 384 | 385 | ; Register mesaage handlers if required 386 | If $bRegisterMsg Then 387 | GUIRegisterMsg($WM_EXITSIZEMOVE, "__Scrollbars_WM_EXITSIZEMOVE") 388 | GUIRegisterMsg($WM_ENTERSIZEMOVE, "__Scrollbars_WM_ENTERSIZEMOVE") 389 | EndIf 390 | 391 | ; Return max GUI size 392 | Return $aMaxSize 393 | 394 | EndFunc ;==>_GUIScrollbars_ReSizer 395 | 396 | ; #FUNCTION# ========================================================================================================= 397 | ; Name...........: _GUIScrollbars_Locate_Ctrl 398 | ; Description ...: Calculates coordinates to use to position controls after scrollbar creation 399 | ; Syntax.........: _GUIScrollbars_Locate_Ctrl ($hWnd, $iX, $iY) 400 | ; Parameters ....: $hWnd -> GUI to contain control 401 | ; $iX -> Horizontal coordinate relative to scrollable area 402 | ; $iY -> Vertical coordinate relative to scrollable area 403 | ; Requirement(s).: v3.3.6.0 or higher 404 | ; Return values .: Success - Returns a 2-element array: 405 | ; [0] = Horizontal coordinate 406 | ; [1] = Vertical coordinate 407 | ; Failure - Returns either 0 with @error set as follows: 408 | ; 1 - Invalid window handle 409 | ; 2 - Parameter error 410 | ; 3 - Window not found 411 | ; Remarks .......; 412 | ; Author ........: Melba23 413 | ; Example........; Yes 414 | ;===================================================================================================================== 415 | Func _GUIScrollbars_Locate_Ctrl($hWnd, $iX, $iY) 416 | 417 | ; Check $hWnd 418 | If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) 419 | 420 | ; Find window info 421 | Local $iIndex = -1 422 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 423 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 424 | Next 425 | If $iIndex = -1 Then Return SetError(3, 0, 0) 426 | 427 | ; Check if location is within scrollable area of the window 428 | If $iX < 0 Or $iY < 0 Then Return SetError(2, 0, 0) 429 | ; Confirm there is a scrollbar in use first 430 | If $__g_aSB_WindowInfoEx[$iIndex][0] > 0 And $iX > $__g_aSB_WindowInfoEx[$iIndex][0] Then Return SetError(2, 0, 0) 431 | If $__g_aSB_WindowInfoEx[$iIndex][1] > 0 And $iY > $__g_aSB_WindowInfoEx[$iIndex][1] Then Return SetError(2, 0, 0) 432 | 433 | ; Calculate factored coordinates if needed 434 | If Not $__g_aSB_WindowInfoEx[$iIndex][4] Then 435 | $iX *= $__g_aSB_WindowInfoEx[$iIndex][2] 436 | $iY *= $__g_aSB_WindowInfoEx[$iIndex][3] 437 | EndIf 438 | 439 | ; Correct for any scrollbar movement 440 | $iX -= _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_HORZ) * $__g_aSB_WindowInfo[$iIndex][2] 441 | $iY -= _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_VERT) * $__g_aSB_WindowInfo[$iIndex][3] 442 | 443 | Local $aRet[2] = [$iX, $iY] 444 | 445 | Return $aRet 446 | 447 | EndFunc ;==>_GUIScrollbars_Locate_Ctrl 448 | 449 | ; #FUNCTION# ========================================================================================================= 450 | ; Name...........: _GUIScrollbars_Scroll_Page 451 | ; Description ...: Scrolls scrollbars generated by _GUIScrollbars_Generate to min, max or page number 452 | ; Syntax.........: _GUIScrollbars_Scroll_Page ($hWnd, [$iH_Scroll_Pos = -1, [$iV_Scroll_Pos = -1]]) 453 | ; Parameters ....: $hWnd -> GUI to contain scrollbars 454 | ; $iH_Scroll_Pos -> Horizontal page number: 455 | ; 0 = No change 456 | ; 1+ = Scroll to page number 457 | ; If page number is over max pages, then scroll to max position 458 | ; $iV_Scroll_Pos -> As $iH_Scroll_Pos for vertical pages 459 | ; Requirement(s).: v3.3.6.0 or higher 460 | ; Return values .: Success: @error = 0 461 | ; Failure: @error set as follows: 462 | ; 1 - hWnd not a valid handle 463 | ; 2 - Scrollbars not generated in that GUI 464 | ; 3 - Invalid position parameters 465 | ; Remarks .......; 466 | ; Author ........: Melba23 467 | ; Example........; Yes 468 | ;===================================================================================================================== 469 | Func _GUIScrollbars_Scroll_Page($hWnd, $iH_Scroll_Pos = 0, $iV_Scroll_Pos = 0) 470 | 471 | Local $iPos 472 | 473 | ; Check $hWnd 474 | If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) 475 | 476 | ; Check $iH/V_Scroll_Pos 477 | If Not (IsInt($iH_Scroll_Pos) And IsInt($iV_Scroll_Pos)) Then Return SetError(3, 0, 0) 478 | 479 | ; Find window info 480 | Local $iIndex = -1 481 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 482 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 483 | Next 484 | If $iIndex = -1 Then Return SetError(2, 0, 0) 485 | 486 | ; Get page sizes 487 | Local $iH_Page = Floor($__g_aSB_WindowInfo[$iIndex][4] / $__g_aSB_WindowInfo[$iIndex][2]) 488 | Local $iV_Page = Floor($__g_aSB_WindowInfo[$iIndex][5] / $__g_aSB_WindowInfo[$iIndex][3]) 489 | 490 | If $iH_Scroll_Pos > 0 Then 491 | $iPos = ($iH_Scroll_Pos - 1) * $iH_Page 492 | If $iPos > $__g_aSB_WindowInfo[$iIndex][6] Then $iPos = $__g_aSB_WindowInfo[$iIndex][6] 493 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $iPos) 494 | EndIf 495 | If $iV_Scroll_Pos > 0 Then 496 | $iPos = ($iV_Scroll_Pos - 1) * $iV_Page 497 | If $iPos > $__g_aSB_WindowInfo[$iIndex][7] Then $iPos = $__g_aSB_WindowInfo[$iIndex][7] 498 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $iPos) 499 | EndIf 500 | 501 | EndFunc ;==>_GUIScrollbars_Scroll_Page 502 | 503 | ; #FUNCTION# ========================================================================================================= 504 | ; Name...........: _GUIScrollbars_EventMonitor 505 | ; Description ...: Save and restores scrollbar positions on GUI minimize/restore 506 | ; Syntax.........: _GUIScrollbars_EventMonitor() 507 | ; Parameters ....: 508 | ; Requirement(s).: v3.3.6.0 or higher 509 | ; Return values .: Success: Returns 1 510 | ; Failure: Returns 0 with error: 511 | ; 1 = Scrollbars not initialised for GUI (should never happen!) 512 | ; Remarks .......; 513 | ; Author ........: Melba23, based on code from rover and czardas 514 | ; Example........; Yes 515 | ;===================================================================================================================== 516 | Func _GUIScrollbars_EventMonitor() 517 | 518 | ; Check non-minimized event flag 519 | If $__g_aSB_WindowInfo[0][7] <> 0 Then 520 | ; Get GUI handle 521 | Local $hWnd = $__g_aSB_WindowInfo[0][7] 522 | ; Find window info 523 | Local $iIndex = -1 524 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 525 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 526 | Next 527 | If $iIndex = -1 Then Return SetError(1, 0, 0) 528 | 529 | ; Retrieve scrollbar visibility data 530 | Local $aVis = $__g_aSB_WindowInfo[$iIndex][1] 531 | 532 | ; Rehide unwanted scrollbars 533 | If $aVis[0] = False Then 534 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False) 535 | EndIf 536 | If $aVis[1] = False Then 537 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, False) 538 | EndIf 539 | ; Set saved scrollbar position on minimize 540 | If $aVis[0] = True Then 541 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $__g_aSB_WindowInfo[$iIndex][9]) 542 | EndIf 543 | If $aVis[1] = True Then 544 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $__g_aSB_WindowInfo[$iIndex][8]) 545 | EndIf 546 | ; Clear event flag 547 | $__g_aSB_WindowInfo[0][7] = 0 548 | 549 | Return 1 550 | 551 | EndIf 552 | 553 | Return 0 554 | 555 | EndFunc 556 | 557 | ; #INTERNAL_USE_ONLY#============================================================================================================ 558 | ; Name...........: __Scrollbars_WM_VSCROLL 559 | ; Description ...: Handler for vertical scrollbar 560 | ; Syntax ........: __Scrollbars_WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam) 561 | ; Return values .: None 562 | ; Author ........: Taken from AutoIt Help file 563 | ; Remarks .......: 564 | ; =============================================================================================================================== 565 | Func __Scrollbars_WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam) 566 | 567 | #forceref $iMsg, $wParam, $lParam 568 | Local $nScrollCode = BitAND($wParam, 0x0000FFFF) 569 | Local $iIndex = -1, $yChar, $yPos 570 | Local $Min, $Max, $Page, $Pos, $TrackPos 571 | 572 | For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 573 | If $__g_aSB_WindowInfo[$x][0] = $hWnd Then 574 | $iIndex = $x 575 | $yChar = $__g_aSB_WindowInfo[$iIndex][3] 576 | ExitLoop 577 | EndIf 578 | Next 579 | If $iIndex = -1 Then Return 0 580 | 581 | Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) 582 | $Min = DllStructGetData($tSCROLLINFO, "nMin") 583 | $Max = DllStructGetData($tSCROLLINFO, "nMax") 584 | $Page = DllStructGetData($tSCROLLINFO, "nPage") 585 | $yPos = DllStructGetData($tSCROLLINFO, "nPos") 586 | $Pos = $yPos 587 | $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") 588 | 589 | Switch $nScrollCode 590 | Case $SB_TOP 591 | DllStructSetData($tSCROLLINFO, "nPos", $Min) 592 | Case $SB_BOTTOM 593 | DllStructSetData($tSCROLLINFO, "nPos", $Max) 594 | Case $SB_LINEUP 595 | DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) 596 | Case $SB_LINEDOWN 597 | DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) 598 | Case $SB_PAGEUP 599 | DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) 600 | Case $SB_PAGEDOWN 601 | DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) 602 | Case $SB_THUMBTRACK 603 | DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) 604 | EndSwitch 605 | 606 | DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) 607 | _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) 608 | _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) 609 | 610 | $Pos = DllStructGetData($tSCROLLINFO, "nPos") 611 | If ($Pos <> $yPos) Then 612 | _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) 613 | $yPos = $Pos 614 | EndIf 615 | 616 | Return $GUI_RUNDEFMSG 617 | 618 | EndFunc ;==>__Scrollbars_WM_VSCROLL 619 | 620 | ; #INTERNAL_USE_ONLY#============================================================================================================ 621 | ; Name...........: __Scrollbars_WM_HSCROLL 622 | ; Description ...: Handler for horizontal scrollbar 623 | ; Syntax ........: __Scrollbars_WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) 624 | ; Return values .: None 625 | ; Author ........: Taken from AutoIt Help file 626 | ; Remarks .......: 627 | ; =============================================================================================================================== 628 | Func __Scrollbars_WM_HSCROLL($hWnd, $iMsg, $wParam, $lParam) 629 | 630 | #forceref $iMsg, $lParam 631 | Local $nScrollCode = BitAND($wParam, 0x0000FFFF) 632 | Local $iIndex = -1, $xChar, $xPos 633 | Local $Page, $Pos, $TrackPos 634 | 635 | For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 636 | If $__g_aSB_WindowInfo[$x][0] = $hWnd Then 637 | $iIndex = $x 638 | $xChar = $__g_aSB_WindowInfo[$iIndex][2] 639 | ExitLoop 640 | EndIf 641 | Next 642 | If $iIndex = -1 Then Return 0 643 | 644 | Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) 645 | $Page = DllStructGetData($tSCROLLINFO, "nPage") 646 | $xPos = DllStructGetData($tSCROLLINFO, "nPos") 647 | $Pos = $xPos 648 | $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") 649 | Switch $nScrollCode 650 | Case $SB_LINELEFT 651 | DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) 652 | Case $SB_LINERIGHT 653 | DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) 654 | Case $SB_PAGELEFT 655 | DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) 656 | Case $SB_PAGERIGHT 657 | DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) 658 | Case $SB_THUMBTRACK 659 | DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) 660 | EndSwitch 661 | 662 | DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) 663 | _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) 664 | _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) 665 | 666 | $Pos = DllStructGetData($tSCROLLINFO, "nPos") 667 | If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0) 668 | 669 | Return $GUI_RUNDEFMSG 670 | 671 | EndFunc ;==>__Scrollbars_WM_HSCROLL 672 | 673 | ; #INTERNAL_USE_ONLY#============================================================================================================ 674 | ; Name...........: __Scrollbars_WM_MOUSEWHEEL 675 | ; Description ...: Handler for vertical mouse wheel scroll 676 | ; Syntax ........: __Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) 677 | ; Return values .: None 678 | ; Author ........: Based on code from MrCreator & Malkey 679 | ; Remarks .......: Pressing Ctrl or Shft will move the Horizontal scrollbar with the vertical mousewheel 680 | ; =============================================================================================================================== 681 | Func __Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) 682 | 683 | #forceref $hWnd, $iMsg, $lParam 684 | Local $iDirn, $iDelta = BitShift($wParam, 16) ; Mouse wheel movement 685 | ; Find window index 686 | Local $iIndex = -1 687 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 688 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 689 | Next 690 | If $iIndex <> -1 Then 691 | If BitAND($wParam, 0x0000FFFF) Then ; If Ctrl or Shft pressed move Horz scrollbar 692 | $iDirn = $SB_LINERIGHT 693 | If $iDelta > 0 Then $iDirn = $SB_LINELEFT 694 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][6] 695 | _SendMessage($hWnd, $WM_HSCROLL, $iDirn) 696 | Next 697 | Else ; Move Vert scrollbar 698 | $iDirn = $SB_LINEDOWN 699 | If $iDelta > 0 Then $iDirn = $SB_LINEUP 700 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][6] 701 | _SendMessage($hWnd, $WM_VSCROLL, $iDirn) 702 | Next 703 | EndIf 704 | EndIf 705 | 706 | Return $GUI_RUNDEFMSG 707 | 708 | EndFunc ;==>__Scrollbars_WM_MOUSEWHEEL 709 | 710 | ; #INTERNAL_USE_ONLY#============================================================================================================ 711 | ; Name...........: __Scrollbars_WM_MOUSEHWHEEL 712 | ; Description ...: Handler for horizontal mouse wheel scroll 713 | ; Syntax ........: __Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) 714 | ; Return values .: None 715 | ; Author ........: Based on code from MSDN, MrCreator & Malkey 716 | ; Remarks .......: This function is used internally by _Scrollbars_Generate 717 | ; =============================================================================================================================== 718 | Func __Scrollbars_WM_MOUSEHWHEEL($hWnd, $iMsg, $wParam, $lParam) 719 | 720 | #forceref $hWnd, $iMsg, $lParam 721 | Local $iDirn = $SB_LINERIGHT 722 | If BitShift($wParam, 16) > 0 Then $iDirn = $SB_LINELEFT ; Mouse wheel movement 723 | ; Find window index 724 | Local $iIndex = -1 725 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 726 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 727 | Next 728 | If $iIndex <> -1 Then 729 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][5] 730 | _SendMessage($hWnd, $WM_HSCROLL, $iDirn) 731 | Next 732 | EndIf 733 | 734 | Return $GUI_RUNDEFMSG 735 | 736 | EndFunc ;==>__Scrollbars_WM_MOUSEHWHEEL 737 | 738 | ; #INTERNAL_USE_ONLY#============================================================================================================ 739 | ; Name...........: __Scrollbars_WM_KEYUP 740 | ; Description ...: Handler for scrolling with cursor, pageup/down, home, and end keys 741 | ; Syntax ........: __Scrollbars_WM_KEYUP($hWnd, $iMsg, $wParam, $lParam) 742 | ; Return values .: None 743 | ; Author ........: Based on code from Sm0ke_N 744 | ; Remarks .......: Pressing Ctrl with the Home and End keys will move the Horizontal scrollbar 745 | ; =============================================================================================================================== 746 | Func __Scrollbars_WM_KEYUP($hWnd, $iMsg, $wParam, $lParam) 747 | 748 | #forceref $hWnd, $iMsg, $lParam 749 | 750 | Local $aRet_Ctrl 751 | ; Find window index 752 | Local $iIndex = -1 753 | For $i = 0 To UBound($__g_aSB_WindowInfo) - 1 754 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 755 | Next 756 | If $iIndex <> -1 Then 757 | ; Check if Ctrl pressed 758 | Local $bCtrl = False 759 | $aRet_Ctrl = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", "0x11") 760 | If $aRet_Ctrl[0] Then $bCtrl = True 761 | ; Check key pressed 762 | Switch $wParam 763 | Case 0x21 ; PageUp 764 | If $bCtrl Then 765 | _SendMessage($hWnd, $WM_HSCROLL, $SB_PAGELEFT) 766 | Else 767 | _SendMessage($hWnd, $WM_VSCROLL, $SB_PAGEUP) 768 | EndIf 769 | Case 0x22 ; PageDown 770 | If $bCtrl Then 771 | _SendMessage($hWnd, $WM_HSCROLL, $SB_PAGERIGHT) 772 | Else 773 | _SendMessage($hWnd, $WM_VSCROLL, $SB_PAGEDOWN) 774 | EndIf 775 | Case 0x23 ; End 776 | If $bCtrl Then 777 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $__g_aSB_WindowInfo[$iIndex][6]) 778 | Else 779 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $__g_aSB_WindowInfo[$iIndex][7]) 780 | EndIf 781 | Case 0x24 ; Home 782 | If $bCtrl Then 783 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, 0) 784 | Else 785 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, 0) 786 | EndIf 787 | Case 0x25 ; Left 788 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][5] 789 | _SendMessage($hWnd, $WM_HSCROLL, $SB_LINELEFT) 790 | Next 791 | Case 0x26 ; Up 792 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][5] 793 | _SendMessage($hWnd, $WM_VSCROLL, $SB_LINEUP) 794 | Next 795 | Case 0x27 ; Right 796 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][5] 797 | _SendMessage($hWnd, $WM_HSCROLL, $SB_LINERIGHT) 798 | Next 799 | Case 0x28 ; Down 800 | For $i = 1 To $__g_aSB_WindowInfoEx[$iIndex][5] 801 | _SendMessage($hWnd, $WM_VSCROLL, $SB_LINEDOWN) 802 | Next 803 | EndSwitch 804 | EndIf 805 | Return $GUI_RUNDEFMSG 806 | EndFunc ;==>__Scrollbars_WM_KEYUP 807 | 808 | ; #INTERNAL_USE_ONLY#============================================================================================================ 809 | ; Name...........: __Scrollbars_WM_ENTERSIZEMOVE 810 | ; Description ...: Handler for detecting when GUI resizing is started 811 | ; Syntax ........: __Scrollbars_WM_ENTERSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) 812 | ; Return values .: None 813 | ; Author ........: Based on code from KaFu 814 | ; Remarks .......: 815 | ; =============================================================================================================================== 816 | Func __Scrollbars_WM_ENTERSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) 817 | 818 | #forceref $hWnd, $iMsg, $wParam, $lParam 819 | 820 | ; Check GUI has generated scrollbars 821 | For $iIndex = 1 To $__g_aSB_WindowInfo[0][0] 822 | If $hWnd = $__g_aSB_WindowInfo[$iIndex][0] Then 823 | ; Store current scrollbar positions 824 | $__g_aSB_WindowInfo[0][1] = _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_HORZ) 825 | $__g_aSB_WindowInfo[0][2] = _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_VERT) 826 | ; Reset scrollbar positions to 0 827 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, 0) 828 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, 0) 829 | ; Hide scrollbars 830 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) 831 | ; Store GUI handle and index 832 | $__g_aSB_WindowInfo[0][3] = $hWnd 833 | $__g_aSB_WindowInfo[0][4] = $iIndex 834 | ExitLoop 835 | EndIf 836 | Next 837 | 838 | EndFunc ;==>__Scrollbars_WM_ENTERSIZEMOVE 839 | 840 | ; #INTERNAL_USE_ONLY#============================================================================================================ 841 | ; Name...........: __Scrollbars_WM_EXITSIZEMOVE 842 | ; Description ...: Handler for detecting when GUI resizing is complete 843 | ; Syntax ........: __Scrollbars_WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) 844 | ; Return values .: None 845 | ; Author ........: Based on code from KaFu 846 | ; Remarks .......: 847 | ; =============================================================================================================================== 848 | Func __Scrollbars_WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) 849 | 850 | #forceref $hWnd, $iMsg, $wParam, $lParam 851 | 852 | ; Check if handle matches 853 | If $hWnd = $__g_aSB_WindowInfo[0][3] And $__g_aSB_WindowInfo[0][4] <> -1 Then 854 | ; Retrieve index 855 | Local $iIndex = $__g_aSB_WindowInfo[0][4] 856 | ; Get final size 857 | Local $aClientSize = WinGetClientSize($hWnd) 858 | ; Check if scrollbars needed 859 | Local $iH_Aperture = 0, $iV_Aperture = 0, $iH_Reduction = 0, $iV_Reduction = 0 860 | ; Loop to check if client area reduced by scrollbars 861 | For $i = 1 To 2 862 | If $aClientSize[0] < $__g_aSB_WindowInfoEx[$iIndex][7] + $iH_Reduction Then 863 | $iH_Aperture = $__g_aSB_WindowInfoEx[$iIndex][7] + $iH_Reduction 864 | $iV_Reduction = $__g_aSB_WindowInfo[0][6] ; Height of HScrollbar 865 | EndIf 866 | If $aClientSize[1] < $__g_aSB_WindowInfoEx[$iIndex][8] + $iV_Reduction Then 867 | $iV_Aperture = $__g_aSB_WindowInfoEx[$iIndex][8] + $iV_Reduction 868 | $iH_Reduction = $__g_aSB_WindowInfo[0][5] ; Width of VScrollbar 869 | EndIf 870 | Next 871 | ; Generate required scrollbars 872 | _GUIScrollbars_Generate($hWnd, $iH_Aperture, $iV_Aperture) 873 | ; Reset scrollbar positions 874 | If $iH_Aperture Then _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $__g_aSB_WindowInfo[0][1]) 875 | If $iV_Aperture Then _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $__g_aSB_WindowInfo[0][2]) 876 | ; Clear GUI handle and index 877 | $__g_aSB_WindowInfo[0][1] = 0 878 | $__g_aSB_WindowInfo[0][4] = -1 879 | EndIf 880 | 881 | EndFunc ;==>__Scrollbars_WM_EXITSIZEMOVE 882 | 883 | ; #INTERNAL_USE_ONLY#============================================================================================================ 884 | ; Name...........: __Scrollbars_WM_SIZE 885 | ; Description ...: Handler for detecting when GUI enters/exits minimized state 886 | ; Syntax ........: __Scrollbars_WM_SIZE($hWnd, $iMsg, $wParam, $lParam) 887 | ; Return values .: None 888 | ; Author ........: Melba23 889 | ; Remarks .......: 890 | ; =============================================================================================================================== 891 | Func __Scrollbars_WM_SIZE($hWnd, $iMsg, $wParam, $lParam) 892 | 893 | #forceref $hWnd, $iMsg, $wParam, $lParam 894 | 895 | ; Find window index 896 | Local $iIndex = -1 897 | For $i = 1 To UBound($__g_aSB_WindowInfo) - 1 898 | If $hWnd = $__g_aSB_WindowInfo[$i][0] Then $iIndex = $i 899 | Next 900 | If $iIndex <> -1 Then 901 | ; Check state 902 | If $hWnd = $__g_aSB_WindowInfo[$iIndex][0] Then 903 | ; If GUI has just been minimized 904 | If BitAND(WinGetState($hWnd), $WIN_STATE_MINIMIZED) And $__g_aSB_WindowInfoEx[$iIndex][9] = False Then 905 | ; Show both scrollbars 906 | _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, True) 907 | ; Get vertical current position and move to top 908 | $__g_aSB_WindowInfo[$iIndex][8] = _GUIScrollBars_GetScrollPos($hWnd, $SB_VERT) 909 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, 0) 910 | ; Get horizontal current position and move to left 911 | $__g_aSB_WindowInfo[$iIndex][9] = _GUIScrollBars_GetScrollPos($hWnd, $SB_HORZ) 912 | _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, 0) 913 | ; Set minimized flag 914 | $__g_aSB_WindowInfoEx[$iIndex][9] = True 915 | ; If GUI has just been restored or maximized from minimized state 916 | ElseIf Not(BitAND(WinGetState($hWnd), $WIN_STATE_MINIMIZED)) And $__g_aSB_WindowInfoEx[$iIndex][9] = True Then 917 | ; Set non-minimized event flag 918 | $__g_aSB_WindowInfo[0][7] = $hWnd 919 | ; Clear minimized flag 920 | $__g_aSB_WindowInfoEx[$iIndex][9] = False 921 | EndIf 922 | EndIf 923 | EndIf 924 | 925 | EndFunc ;==>__Scrollbars_WM_SIZE 926 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is portable program that lets you control menus via autorun.inf files. 2 | It also serves as a portable enforcer for semi-portable programs that don't need installation but do otherwise leave leftovers forever 3 | (i.e. it portabilize non portable apps). 4 | 5 | Inspired by the late 2002 **Net-burner's AMenu**, only with a user-customized menu, unlimited buttons, control over special buttons, native support for "working folders", an ability to delete leftovers by the launched programs, and much more. 6 | You can even submit your own ideas. 7 | 8 | ## Usage 9 | ### Basic use 10 | All you have to do is launch **AutoRun_x64.exe** or **AutoRun_x32.exe** (see [difference](#what-is-the-difference-between-the-32-bit-and-the-64-bit-version)). 11 | 12 | This presents a (multilingual) menu based on an **autorun.inf** file in the same folder. One of the menu's options is to edit this file and thus control the menu. 13 | 14 | The program includes a sample menu with various button configurations. 15 | 16 | ### Special use cases 17 | One user especially developed a way to mass deploy the launcher in various PCs that serve as a **payment (POS) terminal** ([see Wikipedia](https://en.wikipedia.org/wiki/Payment_terminal)) - their method was graciously [detailed here](https://github.com/lwcorp/lwmenu/discussions/10). 18 |
If you made a special case too, please do [show and tell](https://github.com/lwcorp/lwmenu/discussions/categories/show-and-tell)! 19 | 20 | ### Advanced use 21 | * Command line parameters can be used, use the help menu to show them or run the launched with `/?`. 22 | * Present a menu from another folder using `/ini=c:\another folder\` - the path can even contain environment variables (e.g. `/ini=%USERPROFILE%\subfolder\`). 23 | * For those who don't like menus, you can uncomment `;skiptobutton=X` to choose a pre-defined button instead of opening the menu. For example, `skiptobutton=4` will always launch button 4 without opening the menu. It can also be done with a command line parameter `/skiptobutton=X`, meaning you can keep all settings in 1 file, but use multiple shortcuts, each for a another button. 24 | * A filename can be passed as a command line parameter, to be passed tothe launched program. This can work well with `skiptobutton=X` when associating the launcher to certain file extensions. 25 | * Alternatively, you can define an alternate default button using `focusbutton=X` (e.g. `focusbutton=5`) instead of the first button. It can also be done with the command line `/focusbutton=X`. 26 | * For those who don't like tray icons, you can uncomment `;hidetrayicon=1` to run without it. 27 | * You can define registry values, folders and files (even using wildcards), services and drivers to delete after the launched program exists. If that program expects certain registry values/folders/files to exist before it runs, you can have blank entries created automatically by appending the values with `+` (e.g. registry=+HKCU\Software\Test) or also use `backuppath=some_folder` (e.g. `backuppath=.` or `backuppath=c:\folder\backup`), which will automatically backup and restore before/after running the program. 28 | * For registry entries specifically, you can skip a whole backup and just create basic entries like `registry=+HKCU\Software\advanced,accept,1` 29 | * Services can also be created before the program launches. 30 | * If you like to just trick a non portable program, you can define (multiple) `symlink=symlink|target` to link a non portable file/folder into writing into a portable path. This spares the extra write action and possible data loss of backup and restore! Likewise, you can define (multiple) `setenv=variable|value` to fake environmental variables during the session. 31 | * Use the menus's toolbar or start with `/listenv` to get a list of all environment variables. 32 | * Use an extra `|` so that `setenv=folder|path to folder|` will turn relative paths into absolute ones (as required by certain environment variables) 33 | * You can run a program after another program by using `buttonafter=X` (e.g. `buttonafter=4` will run button 4 after another button) and it's possible to chain multiple buttons like that - you can use `hidefrommenu=1` to hide such buttons from the menu 34 | * You can enforce a single instance of launched programs by using `singlerun=1` (either globally or per button). 35 | * You can use `blinktaskbarwhendone=1` (globally or for individual buttons) to blink the taskbar upon completion of the launched program. 36 | * You can use `netaccess=0/1` (globally or for individual buttons) whereas 0 will block network access from the launched progrram from, while 1 will give it one-time network access. 37 | * If an external settings file doesn't exist, a default one will be created. 38 | * If you like to launch progras as admin, you can define `admin=1` (globally or for individual buttons). 39 | * If you like to experiment, you can define `simulate=1` inside entries or run the whole launcher with `/simulate` command line parameter). Clicking buttons in that mode will just report what would have happened instead of actually doing anything. 40 | 41 | ## System requirements 42 | Windows 200X, Windows XP, Windows Vista, Windows 7-11 43 | 44 | ## Screenshots 45 | 46 | ![The Program](https://github.com/user-attachments/assets/ce85ffa3-38df-425e-9573-4235f9da4ec7) 47 | 48 | ![Editing settings](https://github.com/user-attachments/assets/8314c44b-2f35-4647-a7e4-b5fe3827c1e8) 49 | 50 | ## Comparison 51 | 52 | | Feature / Benefit | AutoRun LWMenu ([latest](/../../releases/latest)) | PortableApps.com Platform 29.5 | yaP 0.7.1 | PStart v2.11 | Net-burner's AMenu v1.1 | 53 | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------| 54 | | Last updated | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) 2024 | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) 2024 | 2016 | 2011 | 2002 | 55 | | Button style | Large/3D | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) Iconic/2D | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) Iconic/2D | Large/3D | 56 | | Deleting programs' registry leftovers | Yes | Yes | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 57 | | Deleting programs' file/folder leftovers | Yes | Yes | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 58 | | Can backup/restore apps' registry/folders/files | Yes | Yes | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 59 | | Can work without menus (skip to a specific button) | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 60 | | Can specify which button to initially focus on | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | No | No | 61 | | Accepting user-defined menu properties | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | No | No | 62 | | Accepting user-defined button properties | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | No | No | 63 | | Regular buttons | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Unlimited | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Unlimited | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | Unlimited, but with scrolling | 1-8 | 64 | | Special buttons | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) 1-3 | No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | None | 2 | 65 | | Sub-menus | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Unlimited | ![Gold color](https://placeholder.antonshell.me/img?width=15&color_bg=FFD700&text=+) 1 level | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | Yes, but with scrolling | No | 66 | | Reloading an updated menu dynamically (i.e. without having to relaunch it) | Yes | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 67 | | Support for closing the menu after launching a program | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No Menus | Yes | Yes | 68 | | Commands are stored in | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) autorun.inf (even when blocked by the OS, plus compatible with AMenu's autorun.inf and instantly editable via a special button) | Nowhere, they're just automatically loaded from sub-folders | An additional folder and INI file for each and every launcher (as there's no menu) | An additional XML file | autorun.inf | 69 | | Support for OS paths (e.g. "notepad" instead of "%windir%\notepad.exe") | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | Not relevant since they're loaded from sub-folders | No | No | No | 70 | | Support for "working folders" (i.e. "run from") | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | Yes | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 71 | | Support for relative folders (e.g. "..\..\") | Yes | Yes, because they're loaded from sub-folders of the launcher, wherever it is | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 72 | | Support for creating temporary symlinks i.e. symbolic links (tricking a non portable program to write to a portable path) - requires running as admin plus defining `backuppath=` | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 73 | | Support for environment variables (e.g. "%SystemRoot%\notepad.exe") | Yes | Not relevant since they're loaded from sub-folders | Yes | ![Gold color](https://placeholder.antonshell.me/img?width=15&color_bg=FFD700&text=+) Partial, from a closed list | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 74 | | Support for draft buttons | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | Not relevant since they're loaded from sub-folders | No | No | No | 75 | | Support for chaining together a sequence of commands | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) No | 76 | | Support for enforcing a single instance of launched programs | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | ![Gold color](https://placeholder.antonshell.me/img?width=15&color_bg=FFD700&text=+) Partial, by making them close first through a separate command | No | No | 77 | | Allow running without a tray icon | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | 78 | | Writing to the disk on each use / tracking usage | No | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) Yes | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) Yes | No | 79 | | Graying out buttons that refer to non existing programs | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | Not relevant since they're loaded from sub-folders | No, as there's no menu. But a warning pops up | No | No | 80 | | Support for blinking the taskbar upon completion of the launched program | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No, as there's no menu. But a warning pops up | No | No | 81 | | Embeddeding a default settings file in case of a missing external file | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | Not relevant since they're loaded from sub-folders | No, as there's no menu. But a warning pops up | No | No | 82 | | Can launch programs as admin | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | 83 | | Can either block or allow network access | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | No 84 | | Can launch multiple configurations with a single launcher | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | No | 85 | | Can create or delete services | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | No 86 | | Can delete drivers | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) Yes | No | No | No | No 87 | 88 | ## FAQ 89 | 90 | ### General 91 | #### How is it different from other similar apps? 92 | It offers a unique combination of usually standalone features. See [comparison](#comparison). 93 | 94 | #### Is the program portable? 95 | Yes, no installation is involved. You need to run the main program, see [usage](#usage). 96 | 97 | #### What is the difference between the 32-bit and the 64-bit version? 98 | There are no intentional differences. Even more so, the 32-bit version can still be used in 64-bit operating systems. But the 64-bit version is compiled specifically for such systems. 99 | 100 | #### Can I restore a launched program's settings before launching it? 101 | Yes, this will allow you to portabilize completely non portable programs. See [usage](#usage) how to backup/restore all kinds of settings. 102 | 103 | #### Is there a way to try out deleting/creating leftovers without actually deleting/creating anything? 104 | Yes, see [usage](#usage) on how to activate simulation mode per item or per the entire launcher. 105 | 106 | #### Must I use menus? 107 | No, you can avoid menus altogether either by the command line parameter `/skiptobutton=X` or just uncomment `;skiptobutton=X` to choose a pre-defined button instead of opening the menu. For example, `skiptobutton=4` will always launch button 4 without opening the menu. 108 | 109 | #### Can I create sub-menus? 110 | Each menu displays a link to its parent menu (if such exists). Also, each menu can detect menus in its sub-folders. Alternatively, specify `relativepathandfilename=folder` to load that folder's menu (if it lacks a menu, the folder would be launched regularly). 111 | 112 | Until v1.1, it had to be done indirectly by spreading autorun.inf and autorun.lnk (which calls the actual program) files all over your system, then use `relativepathandfilename=folder\autorun.lnk` to call one menu from another. 113 | 114 | ### Misc 115 | #### Can the menu open automatically in anything other than DRIVE_CDROM? 116 | 117 | While outside of the scope of program, it's understandable why users of this program would want the menu to open automatically in DRIVE_FIXED and DRIVE_REMOVABLE (e.g. USB flash drive). Therefore, here's a summary (based on [Inf handling in Wikipedia](https://en.wikipedia.org/wiki/Autorun.inf#Inf_handling)): 118 | 119 | | Version of Windows | Inf handling of autorun.inf's [AutoRun] section | 120 | |-------------------------------|----------------------------------------------------------------------------------------------------------------------------| 121 | | **Windows 9X/Me** | | 122 | | DRIVE_CDROM | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) "open" command is executed automatically | 123 | | DRIVE_REMOVABLE / DRIVE_FIXED | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) "open" command is executed automatically | 124 | | **Windows XP/XP SP1** | | 125 | | DRIVE_CDROM | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) "open" command is executed automatically | 126 | | DRIVE_REMOVABLE / DRIVE_FIXED | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) "open" command is disabled | 127 | | **Windows XP SP2/SP3+** | | 128 | | DRIVE_CDROM | ![Green Color](https://placeholder.antonshell.me/img?width=15&color_bg=green&text=+) "open" command is executed automatically | 129 | | DRIVE_REMOVABLE / DRIVE_FIXED | ![Yellow color](https://placeholder.antonshell.me/img?width=15&color_bg=FFFF00&text=+) "open" command can be enabled by "**action=My menu**" | 130 | | **Windows Vista** | | 131 | | DRIVE_CDROM | ![Yellow color](https://placeholder.antonshell.me/img?width=15&color_bg=FFFF00&text=+) "open" command can be enabled by "**action=My menu**" | 132 | | DRIVE_REMOVABLE / DRIVE_FIXED | ![Yellow color](https://placeholder.antonshell.me/img?width=15&color_bg=FFFF00&text=+) "open" command can be enabled by "**action=My menu**" | 133 | | **Windows 7+** | | 134 | | DRIVE_CDROM | ![Yellow color](https://placeholder.antonshell.me/img?width=15&color_bg=FFFF00&text=+) "open" command can be enabled by "**action=My menu**" | 135 | | DRIVE_REMOVABLE / DRIVE_FIXED | ![Red Color](https://placeholder.antonshell.me/img?width=15&color_bg=FF0000&text=+) "open" command is disabled | 136 | 137 | **Conclusion:** Starting from Windows XP, Microsoft tried to limit the "open" command support to DRIVE_CDROM. While later versions did back down somewhat, Windows 7 once again completely disabled it. So if your audiences use Windows 7 and above, you'll have to teach them how to browse for autorun.exe manually. For older audiences or CDROMs, you can still use the "action" trick. 138 | 139 | ### License 140 | #### Is the program free? 141 | Yes, it's open source (as of version 1.3.4). 142 |
Prior to that, it was a freeware (starting in version 1.3.1). 143 |
Originally it was a time unlimited shareware with a possibility to register. 144 | 145 | #### Registered version (no longer needed) 146 | 147 | ##### What were the benefits of registering? 148 | 149 | These features are now free, but originally they only worked for registered users: 150 | 151 | * No "trial mode" in the title. 152 | * Support for deleting leftover files/folders (including re-creating empty folders). 153 | * Ability to hide special buttons. 154 | * Supporting future development. 155 | 156 | ##### What was the definition of "Life" in Life license? 157 | Before the program was free, users could choose between 1 year and Life. The latter meant the life of the product. That is, updates for as long as there are updates. 158 | Choosing the license showed dedication and support for future versions. The price was not too expensive anyway, so there was no a big loss even if there were no more updates. 159 | 160 | ##### Did it phone home? 161 | Before the program was free, it didn't phone home per se. But it did validate one's license key every once in a while. Product activation ([see Wikipedia](https://en.wikipedia.org/wiki/Product_activation)) is the only way to combat crackers. It's not the best way so much as it's the only realistic way. Validation only occurred seldom and was quick and automated. It did alert to its presence to maintain full disclosure. Precautions were made so only abnormal long Internet connection dropouts would result in the need to re-register one's license key (once the connection was finally back). 162 | --------------------------------------------------------------------------------