Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/2019 in all areas

  1. Correction of errors in the $dtag_IUIAutomationRangeValuePattern definition in UIA_Constants.au3 as reported by rmckay in this thread. New zip-file at bottom of first post. The zip-file in the UIA Code example is updated accordingly.
    3 points
  2. iamtheky

    A better pattern (SRER)

    more fun than i had gathered... i'd probably use stringreplace to test the number of times it appears, then act off the value in extended Local $Paths = 'C:\Users\' & @CRLF & _ 'C:\EEC (1)\' & @CRLF & _ 'C:\EEC (1)\someother file' & @CRLF & _ 'C:\MSfree\' & @CRLF $sSearch = "C:\EEC (1)\" stringreplace($Paths , $sSearch , $sSearch) $sOutput = @Extended = 1 ? StringStripWS(stringreplace($Paths , $sSearch , "") , 4) : @Extended & " matches for: " & $sSearch MsgBox("", "", $sOutput)
    1 point
  3. If you read GUIRegisterMsg help file carefully, you would have seen this : Warning: blocking of running user functions which executes window messages with commands such as "MsgBox()" can lead to unexpected behavior, the return to the system should be as fast as possible !!!
    1 point
  4. Nickolai, two things: Please do not quote every post when answering. We know what we have written. It just clutters the thread. Simply nter your reply into the inputfield at the end of the thread. Give meaningful titles to your posts. Everyone on this forum is looking for help/a solution Thanks
    1 point
  5. Hi everybody New version 901r (Dec 29, 2019)  1 functionality added : Numeric sort on any column (right click on column header) Download link at the end of 1st post
    1 point
  6. Try this: ; Conway's_Game_of_Life ; code from https://rosettacode.org/wiki/Conway%27s_Game_of_Life#BASIC256 #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() OnAutoItExitRegister("_Terminate") Global $iX = 59, $iY = 35, $iH = 8 ; fastgraphics Global $graphwidth = $iX * $iH Global $graphheight = $iY * $iH Global $color, $hMain Global Enum $black, $purple, $green, $red, $yellow Global $aColors[] = [0xFF000000, 0xFFFF00FF, 0xFF00FF00, 0xFFFF0000, 0xFFFFFF00] Global $hGraphics, $hColor, $hDC, $hHBitmap, $hDC_backbuffer, $DC_obj _GraphSize($graphwidth, $graphheight) Global $aC[$iX][$iY], $aCN[$iX][$iY], $aCL[$iX][$iY] ; Thunderbird methuselah $aC[$iX / 2 - 1][$iY / 3 + 1] = 1 $aC[$iX / 2][$iY / 3 + 1] = 1 $aC[$iX / 2 + 1][$iY / 3 + 1] = 1 $aC[$iX / 2][$iY / 3 + 3] = 1 $aC[$iX / 2][$iY / 3 + 4] = 1 $aC[$iX / 2][$iY / 3 + 5] = 1 $iS = 0 Do $color = $black ;rect(0, 0, $graphwidth, $graphheight) ; erase the screen _WinAPI_BitBlt($hDC_backbuffer, 0, 0, $graphwidth, $graphheight, $hDC_backbuffer, 0, 0, $BLACKNESS) $alive = 0 $stable = 1 $iS = $iS + 1 For $y = 0 To $iY - 1 For $x = 0 To $iX - 1 $xm1 = Mod(($x - 1 + $iX), $iX) $xp1 = Mod(($x + 1 + $iX), $iX) $ym1 = Mod(($y - 1 + $iY), $iY) $yp1 = Mod(($y + 1 + $iY), $iY) $aCN[$x][$y] = $aC[$xm1][$y] + $aC[$xp1][$y] $aCN[$x][$y] = $aC[$xm1][$ym1] + $aC[$x][$ym1] + $aC[$xp1][$ym1] + $aCN[$x][$y] $aCN[$x][$y] = $aC[$xm1][$yp1] + $aC[$x][$yp1] + $aC[$xp1][$yp1] + $aCN[$x][$y] If $aC[$x][$y] = 1 Then If $aCN[$x][$y] < 2 Or $aCN[$x][$y] > 3 Then $aCN[$x][$y] = 0 Else $aCN[$x][$y] = 1 $alive = $alive + 1 EndIf Else If $aCN[$x][$y] = 3 Then $aCN[$x][$y] = 1 $alive = $alive + 1 Else $aCN[$x][$y] = 0 EndIf EndIf If $aC[$x][$y] Then If $aCN[$x][$y] Then If $aCL[$x][$y] Then $color = $purple ; adult If Not $aCL[$x][$y] Then $color = $green ; newborn Else If $aCL[$x][$y] Then $color = $red ; old If Not $aCL[$x][$y] Then $color = $yellow ; shortlived EndIf ;~ rect($x * $iH, $y * $iH, $iH, $iH) _GDIPlus_BrushSetSolidColor($hColor, $aColors[$color]) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGraphics, "handle", $hColor, "float", $x * $iH, "float", $y * $iH, _ "float", $iH, "float", $iH) EndIf Next ; $x Next ; $y _WinAPI_BitBlt($hDC, 0, 0, $graphwidth, $graphheight, $hDC_backbuffer, 0, 0, $SRCCOPY) ;blit drawn bitmap to GUI ; refresh ; pause 0.06 Sleep(50) ; Copy arrays For $i = 0 To $iX - 1 For $j = 0 To $iY - 1 If $aCL[$i][$j] <> $aCN[$i][$j] Then $stable = 0 $aCL[$i][$j] = $aC[$i][$j] $aC[$i][$j] = $aCN[$i][$j] Next ; $j Next ; $i Until Not $alive Or $stable If Not $alive Then $sMsg = "Died in " & $iS & " iterations" ; $color = $black ; rect(0, 0, $graphwidth, $graphheight) ; refresh Else $sMsg = "Stabilized in " & ($iS - 2) & " iterations" EndIf MsgBox(0, "job done", $sMsg) Func _GraphSize($graphwidth, $graphheight) $hMain = GUICreate("Conway's_Game_of_Life", $graphwidth, $graphheight) GUISetBkColor(0) GUISetState(@SW_SHOW, $hMain) $hDC = _WinAPI_GetDC($hMain) $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $graphwidth, $graphheight) $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hGraphics, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) $hColor = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) ; create a brush EndFunc ;==>_GraphSize Func rect($x, $y, $w, $h) ;~ _GDIPlus_BrushSetSolidColor($hColor, $aColors[$color]) ;~ _GDIPlus_GraphicsFillRect($hGraphics, _ ;~ $x, _ ; Horizontal pixel position ;~ $y, _ ; Vertical pixel position ;~ $w, $h, _ ; pixel sides ;~ $hColor) EndFunc ;==>rect Func _Terminate() ; Clean up resources _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hMain, $hDC) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BrushDispose($hColor) _GDIPlus_Shutdown() GUIDelete($hColor) Exit EndFunc ;==>_Terminate 😉
    1 point
  7. it's simple, use GUICtrlCreateTab() and hide it #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;~ Global $MENU_HOVER = '' ;~ Global $MENU_SELECTED = '' ;~ Global $COLOR_STANDARD = 0x94A5E9 ;~ Global $COLOR_HOVER = 0x8292d1 ;~ Global $COLOR_SELECTED = 0x7584bf Global $aLabels[18][5] $aLabels[0][0] = UBound($aLabels) -1 SplashTextOn("..loading many things..", "..wait a sec..") $MENU = GUICreate("Menu", 615, 437, -1, -1, -1, $WS_EX_COMPOSITED) GUISetFont(10, 400, 0, "Arial") For $n = 1 To $aLabels[0][0] $aLabels[$n][0] = GUICtrlCreateButton("Menu " & $n, 8, 8 + (24 * ($n - 1)), 106, 23) Next $aLabels[0][1] = GUICtrlCreateTab(200,100,300,300) GUICtrlSetState(-1, $GUI_HIDE) For $n = 1 To $aLabels[0][0] $aLabels[$n][1] = GUICtrlCreateTabItem("Tab " & $n) For $m = 1 To 17 ; or whatever For $o = 1 To 5 Switch Random(1, 5, 1) Case 1 GUICtrlCreateLabel("entry " & $n & " (" &$o & "," & $m & ")",100 + (85 * $o) , 8 + (24 * ($m - 1)), 70) Case 2 GUICtrlCreateButton("entry " & $n & " (" &$o & "," & $m & ")",100 + (85 * $o) , 8 + (24 * ($m - 1)), 70) Case 3 GUICtrlCreateInput("entry " & $n & " (" &$o & "," & $m & ")",100 + (85 * $o) , 8 + (24 * ($m - 1)), 70) Case 4 GUICtrlCreateCheckbox("entry " & $n & " (" &$o & "," & $m & ")",100 + (85 * $o) , 8 + (24 * ($m - 1)), 70) Case 5 GUICtrlCreateRadio("entry " & $n & " (" &$o & "," & $m & ")",100 + (85 * $o) , 8 + (24 * ($m - 1)), 70) EndSwitch Next Next Next GUISetState(@SW_SHOW, $MENU) SplashOff() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case 0, -5, -6, -7, -8, -9, -10, -11 ; save CPU Case $GUI_EVENT_CLOSE GUIDelete() Exit Case Else For $n = 1 To $aLabels[0][0] If $nMsg = $aLabels[$n][0] Then GUICtrlSetState($aLabels[$n][1], $GUI_SHOW) EndIf Next EndSwitch WEnd
    1 point
  8. pixelsearch

    CSV file editor

    Hi everybody, New version 901n (Dec 20, 2019) 1 functionality added : pipe | delimiter allowed (t0nZ suggestion) Download link at the end of 1st post
    1 point
  9. pixelsearch

    CSV file editor

    @t0nZ: glad you liked the script Pipe was also used as a delimiter in the first versions of the script (along with comma, semicolon, tab). I took it away because natively it would have interfered with : 1) GUICtrlSetData 2nd parameter as you mentioned (default separator is pipe) 2) Listview headers (default separator is pipe) 3) Listview items/subitems (default separator is pipe) 4) Content of the imported file : for example a csv file (pipe delimited) containing a pipe in one cell 5) Pipe is used in RegExp (during the script) Some of these cases are already solved in the actual script, I need to check them again. This concerns case 1) and the first versions of the script should do it : ; actual version (without pipe as delimiter) Local $idDelimiter = GUICtrlCreateCombo(" , comma delimited", 154, 32, 141, 25, _ BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData($idDelimiter, " ; semicolon| tab") ; first versions (with pipe as delimiter) Local $idDelimiter = GUICtrlCreateCombo(" , comma delimited", 154, 32, 141, 25, _ BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) Local $sDataSeparator = Opt("GUIDataSeparatorChar", "*") ; changing "|" (default) to "*" GUICtrlSetData($idDelimiter, " ; semicolon* tab* | pipe") Opt("GUIDataSeparatorChar", $sDataSeparator) ; reset original Data Separator to "|" But it shouldn't be enough to export without problem, depending on the input file. I'll rework it soon to include again pipe as delimiter and have it worked in all cases.
    1 point
  10. Local $AutoItPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") If FileExists($AutoItPath & '\AutoIt3.exe') Then FileWrite(@TempDir & '\~test.au3', 'MsgBox(0,@AutoItVersion,"' & 'Installed in: ' & $AutoItPath & '")') Run('"' & $AutoItPath & '\AutoIt3.exe" ' & '"' & @TempDir & '\~test.au3"') Else MsgBox(48, "", "Can't find AutoIt installed path!") EndIf
    1 point
×
×
  • Create New...