Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/15/2013 in all areas

  1. Jon

    AutoIt v3.3.9.17 Beta

    File Name: AutoIt v3.3.9.17 Beta File Submitter: Jon File Submitted: 15 Aug 2013 File Category: Beta 3.3.9.17 (15th August, 2013) (Beta) AutoIt: - Added: StringReverse() - a UTF16 compatible string reversal function. - Added: FileReadToArray() - native version of _FileReadToArray(). - Changed: Some misc internal rewrites in array assignment mean that some large internal array assignments (StringRegExp() for example) may be slightly quicker. Maybe. - Fixed #2366: For loop not working as expected. UDFs: Others: - Added: Sublime Text AutoIt.tmLanguage file to the editors folder. This contains a list of up to date functions. - Fixed: StringRegExpGUI missing from the help file index menu. Plus, lots of helpfile changes. Click here to download this file
    6 points
  2. This thread is a joke.
    3 points
  3. This answer will be extreme: If your code is well written, no AutoIt Error messagebox will ever show up.
    3 points
  4. mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples
    1 point
  5. It's catch-22 reallt, if we don't include as much detail as we can in the help file, then users are more likely to become deterred from using the help file or revert to the Forum. On the other-hand, if we bombard each section with too much information, then they might look to the Forum for easier explanation. As they say, less is more!
    1 point
  6. _IEErrorHandlerRegister("MyErrFunc") Do Sleep(100) $oForm = _IEFormGetObjByName($oFrame, 'ClEquipmentTraceProfileForm') Until IsObJ($oForm) Func MyErrFunc() Return EndFunc ;==>MyErrFunc
    1 point
  7. AndreyS, The $WS_EX_TOPMOST style has a value of 0x00000008. You could perhaps check the current extended style value to see if it is set: #include <Constants.au3> ; Do not forget these include files! #include <WinAPI.au3> $iExStyle = _WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE) If BitAnd($iExStyle, 0x00000008) Then MsgBox($MB_SYSTEMMODAL, "OnTop", "Set" ELse MsgBox($MB_SYSTEMMODAL, "OnTop", "Not Set" EndIf Try it out and see if it works - please let us know the answer. M23
    1 point
  8. AndreyS, From the Help file: "WinSetOnTop ( "title", "text", flag ) flag - Determines whether the window should have the "TOPMOST" flag set. 1=set on top flag, 0 = remove on top flag " M23
    1 point
  9. Update: Pillip Hazel (PCRE author) just confirms that with linksize = 2, PCRE hits its internal limit of 64K while reaching 1589395 bytes of pattern (short 1599858 - 1589395 = 10463 pattern bytes only!) on his Linux box. What that means is that we're fairly close to be able to handle regexps that large including an enormous number of non-capturing groups and alternations. Therefore I don't see the need to bump to linksize 3 as we would incur pointless penalty in real-world uses.
    1 point
  10. AndreyS, Then you can check within the function like this: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $Form1=GUICreate("main", 200,200,100,100) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Time=GUICtrlCreateLabel("00:00",90,90) $b1=GUICtrlCreateButton("1",10,10) GUICtrlSetOnEvent($b1, "_Button") $b2=GUICtrlCreateButton("2",10,50) GUICtrlSetOnEvent($b2, "_Button") $b3=GUICtrlCreateButton("3",10,90) GUICtrlSetOnEvent($b3, "_Button") GUISetState(@SW_SHOW, $Form1) While 1 Sleep(10) WEnd Func _Button() Switch @GUI_CtrlId Case $b1 MsgBox(0,0,1) Case $b2 MsgBox(0,0,2) Case $b3 MsgBox(0,0,3) EndSwitch EndFunc Func Quit() Exit EndFunc Clear now? M23 Edit: I have just seen your edit above. If by "combination" you mean HotKey then you can do something like this: #include <GUIConstantsEx.au3> HotKeySet("^q", "_HotKey") Opt("GUIOnEventMode", 1) $Form1=GUICreate("main", 200,200,100,100) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Time=GUICtrlCreateLabel("00:00",90,90) $b1=GUICtrlCreateButton("1",10,10) GUICtrlSetOnEvent($b1, "_Button") $b2=GUICtrlCreateButton("2",10,50) GUICtrlSetOnEvent($b2, "_Button") $b3=GUICtrlCreateButton("3",10,90) GUICtrlSetOnEvent($b3, "_Button") GUISetState(@SW_SHOW, $Form1) While 1 Sleep(10) WEnd Func _Function($iIndex) MsgBox(0, 0, $iIndex) EndFunc Func _HotKey() _Function(0) EndFunc Func _Button() Switch @GUI_CtrlId Case $b1 _Function(1) Case $b2 _Function(2) Case $b3 _Function(3) EndSwitch EndFunc Func Quit() Exit EndFunc Does that help? M23
    1 point
  11. 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
  12. ;coded by UEZ build 2013-08-14 #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GDIPlus.au3> _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172;, $IMAGE_BITMAP = 0 Global $iW = 400, $iH = 25, $iBGColor = 0xFFFFFF Global Const $hGUI = GUICreate("Monochromatic Blinker", $iW, $iH, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST) GUISetBkColor($iBGColor) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 30 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $fPerc = 0, $aPos, $iPosX, $iPosY Global $aColors[5][2] = [[0xFFEE5F5B, 0xFFF07673],[0xFFABCC04, 0xFFBBD636],[0xFF78CCEE, 0xFF93D6F1],[0xFFFFBB58, 0xFFFFC97A],[0xFFFF6677, 0xFFFF8795]] Global $iRandom = Random(0, UBound($aColors) - 1, 1) $aPos = WinGetPos($hGUI) $iPosX = $aPos[0] $iPosY = $aPos[1] + $aPos[3] Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ToolTip("") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_StripProgressbar($fPerc, $iW, $iH, 0xFF000000 + $iBGColor, $aColors[$iRandom][0], $aColors[$iRandom][1]) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) $fPerc += 0.25 If $fPerc > 100 Then $fPerc = 0 ToolTip(StringFormat("%02d %", $fPerc), $iPosX + $fPerc / 100 * $iW - 1, $iPosY, "", "", 3) $H_TOOLTIP1 = WinGetHandle(StringFormat("%02d %", $fPerc)) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $H_TOOLTIP1, "wstr", "", "wstr", "") DllCall("user32.dll", "int", "SendMessage", "hwnd", $H_TOOLTIP1, "int", 1043, "int", 0xe8e6d9, "int", 0) EndFunc ;==>PlayAnim Func _GDIPlus_StripProgressbar($fPerc, $iW, $iH, $iBgColorGui = 0xFFF0F0F0, $iFgColor = 0xFFEE5F5B, $iBGColor = 0xFFF07673, $sText = "Loading...", $iTextColor = 0x000000, $iDir = -1, $iSpeed = 1, $sFont = "Arial", $bFlip = False, $bHBitmap = True) If $fPerc < 0 Then $fPerc = 0 If $fPerc > 100 Then $fPerc = 100 Local $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0) $hBitmap = $hBitmap[6] Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hCtxt, $iBgColorGui) Local $iWidth = $iH * 2, $iLen = $iWidth / 2, $iY Local $hBmp = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iH, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0) $hBmp = $hBmp[6] Local Const $hCtxt_Bmp = _GDIPlus_ImageGetGraphicsContext($hBmp) Local $hPen = _GDIPlus_PenCreate($iFgColor), $iPenSize = Int($iH / 12) Local $hPen2 = _GDIPlus_PenCreate(0x40000000, $iPenSize) _GDIPlus_GraphicsClear($hCtxt_Bmp, $iBGColor) Local Static $iX = 0 For $iY = 0 To $iH - 1 Switch $iDir Case 1 _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, $iX + $iY, $iY, $iX + $iY + $iLen, $iY, $hPen) _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, $iX + $iY - 2 * $iLen, $iY, $iX + $iY - 1 * $iLen, $iY, $hPen) Case Else _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, -$iX + $iY, $iY, -$iX + $iY + $iLen, $iY, $hPen) _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, -$iX + $iY + 2 * $iLen, $iY, -$iX + $iY + 3 * $iLen, $iY, $hPen) EndSwitch Next Local $tPoint1 = DllStructCreate("float;float") Local $tPoint2 = DllStructCreate("float;float") DllStructSetData($tPoint1, 1, $iW / 2) ;x1 DllStructSetData($tPoint2, 1, $iW / 2) ;x2 Local $hLineBrush If $bFlip Then _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, 0, 0, $iWidth, 0, $hPen2) DllStructSetData($tPoint2, 2, $iH * 2 / 3) ;y2 DllStructSetData($tPoint1, 2, $iH / 3) ;y1 $hLineBrush = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "struct*", $tPoint1, "struct*", $tPoint2, "uint", 0x00FFFFFF, "uint", 0xB0FFFFFF, "int", 0, "int*", 0) $hLineBrush = $hLineBrush[6] _GDIPlus_GraphicsFillRect($hCtxt_Bmp, 0, $iH * 2 / 3 + 1, $iW, $iH / 3, $hLineBrush) Else _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, 0, $iH - $iPenSize / 2, $iWidth, $iH - $iPenSize / 2, $hPen2) DllStructSetData($tPoint1, 2, 0) ;y1 DllStructSetData($tPoint2, 2, $iH / 3) ;y2 $hLineBrush = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "struct*", $tPoint1, "struct*", $tPoint2, "uint", 0xB0FFFFFF, "uint", 0x00FFFFFF, "int", 0, "int*", 0) $hLineBrush = $hLineBrush[6] _GDIPlus_GraphicsFillRect($hCtxt_Bmp, 0, 0, $iW, $iH / 3, $hLineBrush) EndIf $iX = Mod($iX + $iSpeed, $iWidth) Local $hTextureBrush = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "handle", $hBmp, "int", 0, "int*", 0) $hTextureBrush = $hTextureBrush[3] _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $fPerc / 100 * $iW, $iH, $hTextureBrush) If $bFlip Then DllCall($ghGDIPDll, "uint", "GdipImageRotateFlip", "handle", $hBitmap, "int", 6) DllCall($ghGDIPDll, "int", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4) Local $hBrush = _GDIPlus_BrushCreateSolid(0x40000000 + $iTextColor) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local $hFont = _GDIPlus_FontCreate($hFamily, $iH * 3 / 5, 2) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_GraphicsDrawStringEx($hCtxt, $sText, $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_PenDispose($hPen2) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_GraphicsDispose($hCtxt_Bmp) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_BrushDispose($hTextureBrush) _GDIPlus_BrushDispose($hLineBrush) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_StripProgressbar tooltip color
    1 point
  13. If the string with the comma inside is effectively quoted, this should work #include <Array.au3> $str = '"this is some text, and some more text", filedir, ipaddress, hostname,mmmbeer' $res = StringRegExp($str, '[^,"]+|("[^"]*"\h*)', 3) _ArrayDisplay($res)
    1 point
  14. kylomas

    How to create script

    fickri1979, You have several misconceptions regarding message loop processing and multiple gui management. I suggest that you start simple, read the Help file, understand the code that I posted, define exactly what you want to do, and, finally, start coding. Throwing up Koda generated gui's is doing you no good. kylomas
    1 point
  15. kylomas

    How to create script

    Here is a simple example. Run the code using SCiTE, input something, hit enter and watch the console area. #include <GUIConstantsEx.au3> local $gui010 = guicreate('') local $input = guictrlcreateinput('',20,20,100,20) guisetstate() while 1 switch guigetmsg() case $gui_event_close Exit case $input ConsoleWrite('You inputed this >>>> ' & guictrlread($input) & @LF) EndSwitch WEnd
    1 point
  16. I guess my next question is this: why does a recursive file list to array hold such a firm footing on the rock that is your heart? Were you trying to use it as a way to make yourself known as a clever if not spiffy coder? Dreams which were smashed on the rocky shore when your contributions were the last to appear on the rolling credits?
    1 point
  17. I think the issue is communication breakdown. It appears as you are searching C: for file names typed in the search box. But your gui has a box for the html (from what file, where is that coming from? how does that correspond to nearly every file type except an .htm file on the pc?) then the same thing with the bmp box, what bmp are you loading is it only if the user searches for a bmp file? I assume you are saving the search results to some .list file and that is what's being put into the dropdown. I don't see where this is adding any functionality, just a couple ways to display 2 specific file type results. My suggestion would be have a small gui with a searchbox at the top, populate a listview with the search results. Then you can launch the file with a double click using the default program, and/or create a right click menu for however you would like to interact with the selected file (move, delete, rename, open, copy, whatever) If at a later date you think of something else you would like to add, you can simply add it to your right click menu and add a function in your script to handle the new option.
    1 point
×
×
  • Create New...