Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/29/2016 in all areas

  1. Jon

    AutoIt Script-o-matic

    26,019 downloads

    This is the AutoIt's version of Microsoft Scriptomatic tool by SvenP. If you don't know what Scriptomatic is, see: http://www.microsoft.com/technet/scriptcen...s/scripto2.mspx This version is written in AutoIt script AND it produces an AutoIt script ! Requirements: - AutoIt version 3.1.1.8 (or higher) - Some knowledge about WMI Have fun!
    1 point
  2. Autoit does not use a compiler.
    1 point
  3. @qwert I updated the code. Can you try again?
    1 point
  4. Got it now - torus is not visible only when Aero is enabled. One quick and dirty solution is to enable Aero within the script using _WinAPI_DwmEnableComposition(True) and disable Aero again when finished. Anyhow, I will try to find a workaround...
    1 point
  5. Hmmm, multiplication by 1.0 should be faster than division (in FPU assembly at least). $iInt = 12345678901234567 MsgBox(0, "", $iInt*1.0)
    1 point
  6. Melba23

    Sorting

    lesmly, Not too hard to fix: #include <Array.au3> Global $aTable[][] = [[1, 2, 3, 4, 5, 6, 7], [100, 30, -1, 0, -1, 60, 100]] ; Transpose table _ArrayTranspose($aTable) ; Remove negatives Local $aNegTable[UBound($aTable)][UBound($aTable, 2)], $iNegIndex = 0 For $i = UBound($aTable) - 1 To 0 Step -1 If $aTable[$i][1] < 0 Then $aNegTable[$iNegIndex][0] = $aTable[$i][0] $aNegTable[$iNegIndex][1] = $aTable[$i][1] $iNegIndex += 1 _ArrayDelete($aTable, $i) EndIf Next ; Correct neg table size ReDim $aNegTable[2][$iNegIndex] ;_ArrayDisplay($aTable, "", Default, 8) ;_ArrayDisplay($aNegTable, "", Default, 8) ; Sort on second column _ArraySort($aTable, 0, 0, 0, 1) ;_ArrayDisplay($aTable, "Sorted", Default, 8) ; Rejoin arrays _ArrayConcatenate($aTable, $aNegTable) ; Reset to original format _ArrayTranspose($aTable) _ArrayDisplay($aTable, "Result", Default, 8) M23
    1 point
  7. AutoBert

    Sorting

    Here the beginning of a other solution: #include <Array.au3> #include <arraySort2D_MC.au3> Global $aTable[][] = [[1, 2, 3, 4, 5, 6, 7], [100, 30, -1, 0, -1, 60, 100]] _arraySort2D_MC($aTable, "1%N|0",0,0,0,False,True) _ArrayDisplay($aTable, "Result", Default, 8) therefor needed: Func _arraySort2D_MC(ByRef $avArray, $ColOrder, $iStart = 0, $iEnd = 0, $iDesc = 0, $bDelDuplictes = False, $bTranspose = False) ;Parameterübergabe ;$avArray zu sorterendes Array ;$ColdOrder String mit den Sortieranweisungen, getrennt mit "|" für jede Spalte ; zulässige Angaben: ; nur Spaltenindex = normale Sortierung ; Spaltenindex%N = numerische Sortierung ; Spaltenindex%D = Sortierung nach Datum JJJJ/MM/TT ; Spaltenindex%G = Sortierung nach Geburtstag MM/TT/JJJJ ; z.B.: "1|2%N|3%D|0" die Reihenfolge für die Sortierung ist 1.,2., 3. 0. (0 basierend) ; die 1. Spalte wird Standard von _ArraySort verwendet ; die 2. Spalte (%N) wird bei der Sortierun numerisch behnadelt ; die 3. Spalte (%D) wird als Datum behandelt ; ; es müssen alle Spalten des Arrays in den Sortieranweisungen vorkommen ;$iStart Zeile bei der die Sortierung beginnt (OPTIONAL) ;$iEnd Zeile bei der die Sortierung endet (OPTIONAL) ;$iDesc Absteigend 1 = JA 0 = NEIN (OPTIONAL) ;$bDelDuplictes nur einmalige Zeilen zulassen True = Jede Zeile ist einmalig ; False = Es werden alle Zeilen ausgegeben ;$bTranspose nach Zeilen sortieren True = Sortierung nach Zeilen ; False = Sortierung nach Spalten ; ===================================================================== ;Rückgabe: 0 Fehler (nicht alle Spalten in $ColOrder definert ; 1 Erfolg ;Autor: AutoBert 2010 erweeitert 2012 ;============================================================================================================== If $bTranspose Then _ArrayTranspose($avArray) Local $iDims = UBound($avArray, 0) If @error Or $iDims <> 2 Then MsgBox(16, "Fehler:", "kein 2D-Array") Return 0 EndIf If $iEnd = 0 Then $iEnd = UBound($avArray) - 1 If $iEnd > UBound($avArray) - 1 Then $iEnd = UBound($avArray) - 1 $aCols = StringSplit($ColOrder, "|") ;consolewrite($aCols[0] & " " & UBound($array, 2) & @CRLF) If $aCols[0] <> UBound($avArray, 2) Then MsgBox(16, "Fehler:", "unterschiedliche Spaltenanzahl!") Return 0 EndIf Local Const $sLeer = " " Local $aColformat = $aCols Local $sRow For $i = 1 To $aColformat[0] ;$aColformat[$i] = StringRight($aColformat[$i], 1) $aCols[$i] = StringReplace($aCols[$i], "N", "") $aCols[$i] = StringReplace($aCols[$i], "D", "") Next _ArrayDelete($aColformat, 0) _ArrayDelete($aCols, 0) Local $iCols = UBound($aColformat) For $i = $iStart To $iEnd $sRow = "" For $j = 0 To $iCols - 1 $iCol = $aCols[$j] Switch StringUpper(StringRight($aColformat[$j], 1)) Case "N" ;numerisch $aNum = StringSplit($avArray[$i][$iCol], ",") If IsArray($aNum) Then If $aNum[0] = 1 Then _ArrayAdd($aNum, " ") $sRow &= StringRight($sLeer & $aNum[1] & "," & StringLeft($aNum[2]&$sLeer, 30), 99) Else $sRow &= StringRight($sLeer & $aNum[1], 99) EndIf Case "D" ;Datum JJJJ/MM/TT ;consolewrite("D: " & $aColformat[$j] & " " & $avArray[$i][$iCols]) $aDate = StringSplit($avArray[$i][$iCol], ".") If IsArray($aDate) Then $sRow &= $aDate[3] & "." & StringRight("0" & $aDate[2], 2) & "." & StringRight("0" & $aDate[1], 2) Case "G" ;Geburtstags-Datum MM/TT/JJJJ ;consolewrite("D: " & $aColformat[$j] & " " & $avArray[$i][$iCols]) $aDate = StringSplit($avArray[$i][$iCol], ".") If IsArray($aDate) Then $sRow &= StringRight("0" & $aDate[2], 2) & "." & StringRight("0" & $aDate[1], 2) & "." & $aDate[3] Case Else $sRow &= $avArray[$i][$iCol] EndSwitch If $j <> $iCols - 1 Then $sRow &= "|" Next $avArray[$i][0] = $sRow ;consolewrite($sRow & @CRLF) Next _ArraySort($avArray, $iDesc, $iStart, $iEnd) If $bDelDuplictes Then For $i = $iEnd - 1 To $iStart Step -1 If $avArray[$i][0] = $avArray[$i + 1][0] Then _ArrayDelete($avArray, $i + 1) $iEnd -= 1 EndIf Next EndIf ;_ArrayDisplay($avArray) ;_ArrayDisplay($aColformat, "FormatStrings") ;_ArrayDisplay($aCols, "Cols") ;consolewrite($iCols & @CRLF) For $i = $iStart To $iEnd ;consolewrite($avArray[$i][0] & @CRLF) $aSplit = StringSplit($avArray[$i][0], "|", 2) For $j = 0 To $iCols - 1 $iCol = $aCols[$j] Switch StringRight($aColformat[$j], 1) ; Case "X" ;#cs Case "N" ;numerisch $avArray[$i][$iCol] = StringReplace($aSplit[$j], " ", "") if StringRight($avArray[$i][$iCol],1)="," Then $avArray[$i][$iCol] = StringTrimRight($avArray[$i][$iCol], 1) ;consolewrite(" N: " & $avArray[$i][$iCol]) Case "D" ;Datum JJJJ/MM/TT $aDate = StringSplit($aSplit[$j], ".") $avArray[$i][$iCol] = StringReplace($aDate[3] & "." & $aDate[2] & "." & $aDate[1], "_", "") ;consolewrite(" D: " & $avArray[$i][$iCol]) Case "G" ;Geburtstags-Datum MM/TT/JJJJ $aDate = StringSplit($aSplit[$j], ".") $avArray[$i][$iCol] = StringReplace($aDate[2] & "." & $aDate[1] & "." & $aDate[3], "_", "") ;consolewrite(" D: " & $avArray[$i][$iCol]) ;#ce Case Else $avArray[$i][$iCol] = $aSplit[$j] ;consolewrite(" : " & $avArray[$i][$iCol]) EndSwitch Next ;consolewrite(@CRLF) Next If $bTranspose Then _ArrayTranspose($avArray) Return 1 ;_ArrayDisplay($avArray) EndFunc ;==>_arraySort2D_MC but the end of the job, moving <=0 must be done by you.
    1 point
  8. czardas

    Sorting

    You could try ArrayWorkshop in my signature. I think this does what you want. #include <ArrayWorkshop.au3> #include <Array.au3> ; for ArrayDisplay() Local $aArray = [[1,2,3,4,5,6,7],[100,30,' ',0,' ',60,100]] _ArrayDisplay($aArray) Local $aNew[1], $a2 For $i = 0 To UBound($aArray) -1 $a2 = _ExtractRegion($aArray, 1, $i) ; grab each row _ArraySortXD($a2, 2, 2) ; sort numeric (dimension = 2) _ArrayAttach($aNew, $a2) ; attach the result to the new array Next _DeleteRegion($aNew) ; delete the empty row (that we started with) in $aNew _ArrayDisplay($aNew) Edit: I'm assuming the values of -1 are replacements.
    1 point
  9. It was a little joke about your code, because of the use of "Switch True". I thought you forgot the use of Select. Sorry, i'm not good with jokes in english.
    1 point
  10. TurionAltec

    cmd with autoit

    "@comspec / c" is only needed when calling an internal cmd.exe command (like dir, del, type, etc). If the command being run is from an external program, like netstat.exe, it can be run on it's own. In this example I call netstat -n which will return quicker as it's showing just IP addresses, and not trying to resolve the name. Also, depending on what your script is doing, if it's waiting on the results, Using ProcessWaitClose is easier than continuously polling and concatenating the string. #include <Constants.au3> ConsoleWrite(_GetDOSOutput("netstat -n") & @CRLF) Func _GetDOSOutput($sCommand) Local $iPID, $sOutput = "" ;$iPID = Run('"' & @ComSpec & '" /c ' & $sCommand, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) $iPID = Run($sCommand, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ProcessWaitClose($iPID) $sOutput = StdoutRead($iPID, False, False) Return $sOutput EndFunc ;==>_GetDOSOutput That said, what is the OP looking for? Netstat will show connections, but not transfer of data. I have used AutoIT to interpret raw data coming out of "Tshark" (a CLI tool from Wireshark), but if you don't have a very specific filter to narrow down traffic, it will get quickly bogged down with all traffic on your PC.
    1 point
  11. JLogan3o13

    Ghost Interface

    @Adele that is a great explanation of what you want. Now, how about what you have tried? There are functions in the help file for making a GUI always on top, as well as transparency. Why don't you post what you have tried on your own, and where you're stuck?
    1 point
  12. Local $aResult = DllCall("msvcrt.dll", "INT:cdecl", "sprintf", "STR", "", "STR", "%llu", "UINT64", -1) ConsoleWrite($aResult[1] & @CRLF) ;~ 18446744073709551615
    1 point
  13. Hi, Here is a tool coded in AutoIt to edit multiple ini files ( up to 8 at the same time) to include multilanguage support in your script. The script himself have multilanguage support, simply by using : To change language, i read my global.ini file witch inform me what ini file i had to use... ConsoleWrite ( _string_lang(19) ) Func _string_lang($number) $number = _StringRepeat("0",6-StringLen($number)) & $number $string = IniRead($my_ini_folder & $interface_ini_file,"STRING",$number,"NOT_FOUND") Return($string) EndFunc where 19 is the 19 string in ini file witch look like this : Todo : Initial ini file not necessarily "english.ini" Feel free to use it, give me idea, critical or bug found..... As i am french please be gently Multilangue_autoit.zip
    1 point
  14. For those that have an understanding of 1D/2D Arrays or wish to learn, then this post is a good way to start. This isn't a UDF, more of 'what I've discovered' from reading many Forum posts (especially from Melba23, KaFu) about how ReDim should only be used when required and in an efficient way. For those who tend to create their own Arrays it's inevitable that sometimes ReDim will have to be used. Sometimes knowing the final size of the Array isn't known, especially if using FileFindFirstFile/FileFindNextFile to record the file name(s). For most we use ReDim $aArray[$iTotal_Rows + 1] to increase the size of the Array (by 1 Row) but when it comes to Arrays that might have 1000+ items this starts to slow the Script down. So a little trick Melba23/KaFu pointed out, is to only ReDim when really necessary & then if so multiply the size by 1.5 and round to the next integer. Thus reducing the need for 'ReDimming' every time. 17 * 1.5 = 25.5 Ceiling(17 * 1.5) = 26For Example if we were to create an Array with 1000 items using the traditional way, it would require the Array to be ReDimmed (you guessed it) 1000 times, but using the trick (when required and multiply by 1.5) this is reduced to only 16 times! In the tests I conducted this was the difference of 388ms VS 20ms, what a huge speed increase and only on 1000 items. The reason why I haven't made this a UDF is because users declare variables differently. How I do it is I store the row size in index 0 and if using columns I store the size in index 0 & column 1. Others will use Ubound to find the size as they don't store the Array size in the Array or in a variable e.g. For $i = 0 To Ubound($aArray, 1) - 1. Others will store the row size in index 0, but won't keep a reference of how many columns the Array has, especially when they just 'hard code' it in Functions e.g. $aArray[$i][5] += 1. How I declare Arrays: #include <Array.au3> Local $a1D[6] = [5, 1, 2, 3, 4, 5] ; Array count in the 0th element e.g. 5. Local $a2D[6][3] = [[5, 3], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5]] ; Array count in the 0th element, 0th column e.g. 5 and the column count in the 0th element, 1st column e.g. 3. _ArrayDisplay($a1D, '1D Array') _ArrayDisplay($a2D, '2D Array')Therefore have a look at the Examples that are below and read the comments to understand a little further. Comments, suggestions, then please post below. Thanks. Functions. Func _ReDim1D(ByRef $aArray, ByRef $iDimension) ; Where Index [0] is the Row count. If ($aArray[0] + 1) >= $iDimension Then $iDimension = Ceiling(($aArray[0] + 1) * 1.5) ReDim $aArray[$iDimension] Return 1 EndIf EndFunc ;==>_ReDim1D Func _ReDim2D(ByRef $aArray, ByRef $iDimension) ; Where Index [0, 0] is the Row count and Row [0, 1] is the Column count. If ($aArray[0][0] + 1) >= $iDimension Then $iDimension = Ceiling(($aArray[0][0] + 1) * 1.5) ReDim $aArray[$iDimension][$aArray[0][1]] Return 1 EndIf EndFunc ;==>_ReDim2D Func _ReDim1D_Ubound(ByRef $aArray, ByRef $iDimension, ByRef $iCount) ; Using Ubound($aArray, 1) to find the Row size. $iCount += 1 If ($iCount + 1) >= $iDimension Then $iDimension = Ceiling((UBound($aArray, 1) + 1) * 1.5) ReDim $aArray[$iDimension] Return 1 EndIf EndFunc ;==>_ReDim1D_Ubound Func _ReDim2D_Ubound(ByRef $aArray, ByRef $iDimension, ByRef $iCount) ; Using Ubound($aArray, 1) to find the Row size and Ubound($aArray, 2) for the Column size. $iCount += 1 If ($iCount + 1) >= $iDimension Then $iDimension = Ceiling((UBound($aArray, 1) + 1) * 1.5) ReDim $aArray[$iDimension][UBound($aArray, 2)] Return 1 EndIf EndFunc ;==>_ReDim2D_UboundExample use of Functions: #include <Array.au3> #include <Constants.au3> ; Change the value of the $ARRAY_SIZE constant to determine the array size. Global Const $ARRAY_SIZE = 5000 _1D_Slow() ; See how Slow this is by doing it the traditional way of increasing by 1. _1D_1() ; Only ReDim when required and if so mutliply the count by 1.5 and round to the next integer. _1D_2() ; Only ReDim when required and if so mutliply the count by 1.5 and round to the next integer. _2D_1() ; Only ReDim when required and if so mutliply the count by 1.5 and round to the next integer, this also uses Ubound() to find the size of the Array. _2D_2() ; Only ReDim when required and if so mutliply the count by 1.5 and round to the next integer, this also uses Ubound() to find the size of the Array. Func _1D_Slow() Local $aArray[1] = [0], $hTimer = 0, $iCount = 0, $iDimension = 0 $hTimer = TimerInit() ; Start the timer. For $i = 1 To $ARRAY_SIZE ReDim $aArray[($aArray[0] + 1) + 1] ; ReDim the array by adding 1 to the total count and then increasing by 1 for a new row. $iCount += 1 ; If array was ReDimmed then add to the ReDim count for output at the end. $aArray[0] += 1 ; Increase Index [0] by 1. $aArray[$i] = 'Row ' & $i & ': Col 0' ; Add random data. If Mod($i, 1000) = 0 Then ConsoleWrite('It''s still working! Now we''re at about ' & $i & ' elements in the array.' & @CRLF) EndIf Next $hTimer = Round(TimerDiff($hTimer)) ; End the timer and find the difference from start to finish. ReDim $aArray[$aArray[0] + 1] ; Remove the empty Rows, by ReDimming the total count plus the row for holding the count. ; _ArrayDisplay($aArray) MsgBox($MB_SYSTEMMODAL, 'How many times? - _1D_Slow()', 'The amount of times a ' & $ARRAY_SIZE & ' element array was ''ReDimmed'' was ' & $iCount & ' times.' & @CRLF & _ 'It only took ' & $hTimer & ' milliseconds to complete.') EndFunc ;==>_1D_Slow Func _1D_1() Local $aArray[1] = [0], $hTimer = 0, $iCount = 0, $iDimension = 0 $hTimer = TimerInit() ; Start the timer. For $i = 1 To $ARRAY_SIZE If _ReDim1D($aArray, $iDimension) Then ; Returns 1 if ReDimmed OR 0 if it wasn't. This uses ByRef, so just pass the array and a previously delcared variable for monbitoring the dimension. $iCount += 1 ; If array was ReDimmed then add to the ReDim count for output at the end. EndIf $aArray[0] += 1 ; Increase Index [0] by 1. $aArray[$i] = 'Row ' & $i & ': Col 0' ; Add random data. Next $hTimer = Round(TimerDiff($hTimer)) ; End the timer and find the difference from start to finish. ReDim $aArray[$aArray[0] + 1] ; Remove the empty Rows, by ReDimming the total count plus the row for holding the count. ; _ArrayDisplay($aArray) MsgBox($MB_SYSTEMMODAL, 'How many times? - _1D_1()', 'The amount of times a ' & $ARRAY_SIZE & ' element array was ''ReDimmed'' was ' & $iCount & ' times.' & @CRLF & _ 'It only took ' & $hTimer & ' milliseconds to complete.') EndFunc ;==>_1D_1 Func _1D_2() Local $aArray[1] = [0], $hTimer = 0, $iCount = 0, $iDimension, $iIndexTotal = 0 $hTimer = TimerInit() ; Start the timer. For $i = 1 To $ARRAY_SIZE If _ReDim1D_Ubound($aArray, $iDimension, $iIndexTotal) Then ; Returns 1 if ReDimmed OR 0 if it wasn't. This uses ByRef, so just pass the array and a previously delcared variable for monbitoring the dimension and a second variable for monitoring the total count. $iCount += 1 ; If array was ReDimmed then add to the ReDim count for output at the end. EndIf $aArray[0] += 1 ; Increase Index [0] by 1. $aArray[$i] = 'Row ' & $i & ': Col 0' ; Add random data. Next $hTimer = Round(TimerDiff($hTimer)) ; End the timer and find the difference from start to finish. ReDim $aArray[$aArray[0] + 1] ; Remove the empty Rows, by ReDimming the total count plus the row for holding the count. ; _ArrayDisplay($aArray) MsgBox($MB_SYSTEMMODAL, 'How many times? - _1D_2()', 'The amount of times a ' & $ARRAY_SIZE & ' element array was ''ReDimmed'' was ' & $iCount & ' times.' & @CRLF & _ 'It only took ' & $hTimer & ' milliseconds to complete.') EndFunc ;==>_1D_2 Func _2D_1() Local $aArray[1][2] = [[0, 2]], $hTimer = 0, $iCount = 0, $iDimension = 0 $hTimer = TimerInit() ; Start the timer. For $i = 1 To $ARRAY_SIZE If _ReDim2D($aArray, $iDimension) Then ; Returns 1 if ReDimmed OR 0 if it wasn't. This uses ByRef, so just pass the array and a previously delcared variable for monbitoring the dimension. $iCount += 1 ; If array was ReDimmed then add to the ReDim count for output at the end. EndIf $aArray[0][0] += 1 ; Increase Index [0, 0] by 1. $aArray[$i][0] = 'Row ' & $i & ': Col 0' ; Add random data. $aArray[$i][1] = 'Row ' & $i & ': Col 1' ; Add random data. Next $hTimer = Round(TimerDiff($hTimer)) ; End the timer and find the difference from start to finish. ReDim $aArray[$aArray[0][0] + 1][$aArray[0][1]] ; Remove the empty Rows, by ReDimming the total count plus the row for holding the count and include the number of colums too. ; _ArrayDisplay($aArray) MsgBox($MB_SYSTEMMODAL, 'How many times? - _2D_1()', 'The amount of times a ' & $ARRAY_SIZE & ' element array was ''ReDimmed'' was ' & $iCount & ' times.' & @CRLF & _ 'It only took ' & $hTimer & ' milliseconds to complete.') EndFunc ;==>_2D_1 Func _2D_2() Local $aArray[1][2] = [[0, 2]], $hTimer = 0, $iCount = 0, $iDimension = 0, $iIndexTotal = 0 $hTimer = TimerInit() ; Start the timer. For $i = 1 To $ARRAY_SIZE If _ReDim2D_Ubound($aArray, $iDimension, $iIndexTotal) Then ; Returns 1 if ReDimmed OR 0 if it wasn't. This uses ByRef, so just pass the array and a previously delcared variable for monbitoring the dimension and a second variable for monitoring the total count. $iCount += 1 ; If array was ReDimmed then add to the ReDim count for output at the end. EndIf $aArray[0][0] += 1 ; Increase Index [0, 0] by 1. $aArray[$i][0] = 'Row ' & $i & ': Col 0' ; Add random data. $aArray[$i][1] = 'Row ' & $i & ': Col 1' ; Add random data. Next $hTimer = Round(TimerDiff($hTimer)) ; End the timer and find the difference from start to finish. ReDim $aArray[$aArray[0][0] + 1][$aArray[0][1]] ; Remove the empty Rows, by ReDimming the total count plus the row for holding the count and include the number of colums too. ; _ArrayDisplay($aArray) MsgBox($MB_SYSTEMMODAL, 'How many times? - _2D_2()', 'The amount of times a ' & $ARRAY_SIZE & ' element array was ''ReDimmed'' was ' & $iCount & ' times.' & @CRLF & _ 'It only took ' & $hTimer & ' milliseconds to complete.') EndFunc ;==>_2D_2 Func _ReDim1D(ByRef $aArray, ByRef $iDimension) ; Where Index [0] is the Row count. If ($aArray[0] + 1) >= $iDimension Then $iDimension = Ceiling(($aArray[0] + 1) * 1.5) ReDim $aArray[$iDimension] Return 1 EndIf EndFunc ;==>_ReDim1D Func _ReDim2D(ByRef $aArray, ByRef $iDimension) ; Where Index [0, 0] is the Row count and Row [0, 1] is the Column count. If ($aArray[0][0] + 1) >= $iDimension Then $iDimension = Ceiling(($aArray[0][0] + 1) * 1.5) ReDim $aArray[$iDimension][$aArray[0][1]] Return 1 EndIf EndFunc ;==>_ReDim2D Func _ReDim1D_Ubound(ByRef $aArray, ByRef $iDimension, ByRef $iCount) ; Using Ubound($aArray, 1) to find the Row size. $iCount += 1 If ($iCount + 1) >= $iDimension Then $iDimension = Ceiling((UBound($aArray, 1) + 1) * 1.5) ReDim $aArray[$iDimension] Return 1 EndIf EndFunc ;==>_ReDim1D_Ubound Func _ReDim2D_Ubound(ByRef $aArray, ByRef $iDimension, ByRef $iCount) ; Using Ubound($aArray, 1) to find the Row size and Ubound($aArray, 2) for the Column size. $iCount += 1 If ($iCount + 1) >= $iDimension Then $iDimension = Ceiling((UBound($aArray, 1) + 1) * 1.5) ReDim $aArray[$iDimension][UBound($aArray, 2)] Return 1 EndIf EndFunc ;==>_ReDim2D_Ubound
    1 point
  15. AZJIO

    Icons on tabs?

    #include <GUIConstantsEx.au3> #include <TabConstants.au3> Local $tab, $iCombo, $msg, $Gui $Gui = GUICreate("- (Tab) - GUI") GUISetBkColor(0xB4E1D3) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 380, 200) GUICtrlCreateTabItem("Path") GUICtrlSetImage(-1, "shell32.dll", -4, 0) GUICtrlCreateLabel("Path", 40, 43, 270, 17) GUICtrlCreateButton("OK", 314, 60, 46, 25) GUICtrlCreateInput("C:\WINDOWS\system32", 40, 60, 275, 25) GUICtrlCreateTabItem("Style") GUICtrlSetImage(-1, "shell32.dll", -6, 0) GUICtrlSetState(-1, $GUI_SHOW) GUICtrlCreateLabel("Sel. Style", 20, 54, 250, 17) $iCombo = GUICtrlCreateCombo("", 20, 70, 310, 120) GUICtrlSetData(-1, "$GUI_SS_DEFAULT_TAB|$TCS_FIXEDWIDTH|$TCS_FIXEDWIDTH+$TCS_FORCEICONLEFT|$TCS_FIXEDWIDTH+$TCS_FORCELABELLEFT|$TCS_BOTTOM", "$GUI_SS_DEFAULT_TAB") GUICtrlCreateTabItem("?") GUICtrlSetImage(-1, "shell32.dll", -222, 0) GUICtrlCreateLabel("Des", 20, 40, 120, 17) GUICtrlCreateButton("OK", 300, 150, 70, 30) GUICtrlCreateTabItem("") GUICtrlCreateLabel('$TCS_MULTILINE - ' & @CRLF & '$TCS_BUTTONS - ' & @CRLF & '$TCS_FLATBUTTONS+$TCS_BUTTONS - ', 20, 230, 370, 100) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $tab ; отображает кликнутую вкладку WinSetTitle($Gui, "", "- (Tab) - GUI, - " & GUICtrlRead($tab)) Case $iCombo GUICtrlSetStyle($tab, BitOR($GUI_SS_DEFAULT_TAB, Execute(GUICtrlRead($iCombo)))) EndSwitch WEnd
    1 point
×
×
  • Create New...