Leaderboard
Popular Content
Showing content with the highest reputation on 10/18/2015 in all areas
-
Maybe something like this helps ?3 points
-
Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF Changelog: Download UDF with example:1 point
-
I think you need a 'mouse organ' - Monty Python sketch: https://www.youtube.com/watch?v=F9nGyPz9uT01 point
-
Nah, see a lot of Bass but not much speakers to do the 20kHz+ frequencies, unless you simply want to squash it. Jos1 point
-
@kcvinu AutoIt is slower than NET, I think NET has a constant work load with arrays, where as AutoIt has a constant work load with elements of an array... So more elements = more slower in AutoIt1 point
-
ArrayList is a horrible choice, because it's not a generic collection and therefore you have a lot of boxing and unboxing to do during execution. Anyhow, you are aware that under the hood, List and ArrayList are basically arrays that hold the length and current index position? They essentially use Array.Copy() when a new item is added which is outside the current length of the array. If people didn't realise, that's all ReDim is, a syntactic sugary array copying method!1 point
-
Nice! , Why won't you try to make an alternative to ReDim using the "Add" method? Perhaps a snippet would do the magic!1 point
-
Updated UDF to Version 3.0: UDF has been completely rewritten. Version 3.0 will make the usage as easy as never before.Borderless and resizable GUIs with new control buttons (Close,Maximize/Restore,Minimize) in Windows 10 styleNew and updated color schemes/themes. 2 type of Windows 8/10 style buttons with different hover effects.Metro style checkboxes, radios, toggles and progressbar.All buttons, checkboxes etc. have now hover effects!See first post for more details and new pictures.1 point
-
As this seemed to me interesting, so I made some test, with some other HTML RichEdit component and I make it like I describe below. For my case the most important thing was: finding that my page is using Framesusing _IEGetObjByClass and the most importantusing _IEPropertySet($oWebWiz, 'innertext', 'TESTING 123') instead _IEFormElementSetValue() Here is entire example: #include <ie.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $oIE = _IECreate('http://www.quickpdf.org', 1) Local $oFrame = _IEFrameGetCollection($oIE, 4) If @error Then MsgBox($MB_ICONERROR, 'Frame', _ '@error = ' & @error & @CRLF & '@extended = ' & @extended) Local $oWebWiz = _IEGetObjByClass($oFrame, 'WebWizRTEtextarea') If @error Then MsgBox($MB_ICONERROR, 'Class', _ '@error = ' & @error & @CRLF & '@extended = ' & @extended) _IEPropertySet($oWebWiz, 'innertext', 'TESTING 123') If @error Then MsgBox($MB_ICONERROR, '_IEPropertySet', _ '@error = ' & @error & @CRLF & '@extended = ' & @extended) EndFunc ;==>Example Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0) ; http://www.autoitscript.com/forum/topic/98111-iegetobjbyclass/ If Not IsObj($o_object) Then Return SetError(1, 0, 0) EndIf If Not __IEIsObjType($o_object, "browserdom") Then Return SetError(2, 0, 0) EndIf Local $i_found = 0 Local $oTags_coll = _IETagNameAllGetCollection($o_object) For $oTag_enum In $oTags_coll If String($oTag_enum.className) = $s_Class Then If ($i_found = $i_index) Then Return SetError(0, 0, $oTag_enum) Else $i_found += 1 EndIf EndIf Next Return SetError(3, 0, 0) EndFunc ;==>_IEGetObjByClass EDIT: to use this example you should first login with this URL http://www.quickpdf.org/forum/new_topic_form.asp?FID=15 which mean that you open new thread in this mentioned forum. So if you do not have login to above mentioned forum then do not try to use it.1 point
-
wouldnt an empty array be Local $aEmptyArray[0]as your current example is a 1D array with a single element, and that single element is an empty string. #include<array.au3> Local $aEmptyArray[1] _ArrayDisplay($aEmptyArray) ;array with 1 entry msgbox(0, '' , $aEmptyArray[0]) ;empty string Local $aEmptyArray[0] _ArrayDisplay($aEmptyArray) ;array with 0 entries msgbox(0, '' , $aEmptyArray[0]) ;nothing because the array is empty1 point
-
1 point
-
Arrays 101: All you need to know about them!
BlackLumiere reacted to JohnOne for a topic
Not if you are returning it from a fuction. $aArray = StringSplit("123", "");1 point -
And last, but not least, my MailSlot method (courtesy of trancexx's UDF): Label_Master: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "MailSlot.au3" ; Array to hold ControlIDs of labels Global $aData[101] ; Create the Mailslot $sRandomMailSlotname = _RandomStr() $sMailSlotName = "\\.\mailslot\" & $sRandomMailSlotname $hMailSlot = _MailSlotCreate($sMailSlotName) If @error Then MsgBox(48, "MailSlot for Label_Master", "Failed to create account!") Exit EndIf SplashTextOn("Label test", "Creating child processes!") ; Set start time - this allows all child processes to be created before colour changes are started $iBaseMin = @MIN If $iBaseMin = 59 Then $iBaseMin = -1 ; Launch 100 child processes - each will change the colour of one label For $i = 1 To 100 ; Randomize the Random seed for each child or we get the same colour for each! $iSeed = Random(1, 2^10, 1) ; Pass parameters to the child process ShellExecute("Label_Child.exe", $i & " " & $iBaseMin & " " & $iSeed & " " & $sMailSlotName) Next SplashOff() ; Create GUI $hGUI = GUICreate("Label_Master", 510, 510) ; Create labels For $i = 0 To 9 For $j = 0 To 9 $iIndex = $j + ($i * 10) + 1 $aData[$iIndex] = GUICtrlCreateLabel("", 10 + ($j * 50), 10 + ($i * 50), 40, 40) GUICtrlSetBkColor(-1, 0xC4C4C4) GUICtrlSetFont(-1, 18) Next Next GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch ; Is there a message? Local $iSize = _MailSlotCheckForNextMessage($hMailSlot) If $iSize Then ; If so then read it $sMessage = _MailSlotRead($hMailSlot, $iSize, 1) ; Split into sections $aSplit = StringSplit($sMessage, ":") $iIndex = Number($aSplit[1]) $iColour = Number($aSplit[2]) ; Colour label GUICtrlSetBkColor($aData[$iIndex], $iColour) ; Increase count - just to show that each label change get honoured GUICtrlSetData($aData[$iIndex], GUICtrlRead($aData[$iInDex]) + 1) EndIf WEnd Func _RandomStr() Local $sString For $i = 1 To 13 $sString &= Chr(Random(97, 122, 1)) Next Return $sString EndFunc ;==>__RandomStrLabel_Child: #include "MailSlot.au3" If $CmdLine[0] = 0 Then Exit ; Read parameters $iIndex = $CmdLine[1] $iBaseMin = $CmdLine[2] $iSeed = $CmdLine[3] $sMailSlotName = $CmdLine[4] ; Randomize the random process SRandom($iSeed) ; Sleep to allow all child processes to be created Do Sleep(10) Until @MIN >= $iBaseMin + 1 ; 5 cycles For $i = 1 To 5 ; Stagger the requests Sleep(Random(1, 5, 1) * 1000) ; Generate colour $iColour = Dec(Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2)) ; Send colour to MailSlot _MailSlotWrite($sMailSlotName, String($iIndex) & ":" & String($iColour)) NextWell that was a fun way to pass a few hours. What do others think about the 3 different methods? Which seems best suited to the task? M231 point
-
You can simple create a Dummy Button. Program1 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Program1", 260, 109, 192, 124) $Button1 = GUICtrlCreateButton("Change Color", 88, 48, 73, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $hWin=WinGetHandle("[TITLE:Program2]") ControlClick($hWin,"","Button1") EndSwitch WEnd Program2 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Program2", 285, 116, 192, 124) $Label1 = GUICtrlCreateLabel("Danyfirex", 88, 32, 95, 27) GUICtrlSetFont(-1, 14, 400, 0, "Lucida Sans Unicode") GUICtrlSetColor(-1, 0x000000) $btn=GUICtrlCreateButton("Dummy",100,70,80,30) GUICtrlSetState(-1,$GUI_HIDE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn GUICtrlSetBkColor($Label1,ColorConvert( Random(0,255,1)+256*Random(0,255,1)+256*256*Random(0,255,1) )) EndSwitch WEnd Func ColorConvert($iColor) Return BitOR(BitAND($iColor, 0x00FF00), BitShift(BitAND($iColor, 0x0000FF), -16), BitShift(BitAND($iColor, 0xFF0000), 16)) EndFunc Saludos1 point
-
I have been playing a little with performance. This is the fastest I have come to. I have not tried to split it into multiple processes. Run tst07.au3. tst07.au3 Local $hGui = GUICreate('Test', 810, 330) GUISetBkColor("0x9A9A9A", $hGui) Local $sGuiCtrlsMatrix = _GUICtrlsMatrix_Create(5, 5, 50, 20, 15, 15) Local $hFile = FileOpen( "Labels.txt", 2 ) ; 2 = $FO_OVERWRITE FileWriteLine( $hFile, $sGuiCtrlsMatrix ) FileClose( $hFile ) GUISetState(@SW_SHOW) Local $iPID = ShellExecute( "tst08.au3" ) MsgBox(0, "Pause", "Waiting for Godot...") FileDelete( "Labels.txt" ) ProcessClose( $iPID ) Func _GUICtrlsMatrix_Create($xPanelPos, $yPanelPos, $nrPerLine, $nrOfLines, $Width, $Height, $xSpace = 1, $ySpace = 1) Local $sGuiControls = "" For $i = 1 To $nrPerLine * $nrOfLines $row = Int($i / $nrPerLine) + Not(Not(Mod($i, $nrPerLine))) $col = $i - ($row * $nrPerLine - $nrPerLine) $left = $xPanelPos + (($Width + $xSpace) * $col) - ($Width + $xSpace) $top = $yPanelPos + (($Height + $ySpace) * $row) - ($Height + $ySpace) $sGuiControls &= "|" & GUICtrlGetHandle(GUICtrlCreateLabel("", $left, $top, $Width, $Height)) GUICtrlSetBkColor(-1, "0xFFFFFF") Next Return $sGuiControls EndFunc tst08.au3 #include <WinAPI.au3> While Not FileExists( "Labels.txt" ) Sleep( 50 ) WEnd Local $sLabels = FileReadLine( "Labels.txt" ) Local $aLabels = StringSplit( $sLabels, "|", 2 ) ; 2 = $STR_NOCOUNT Local $aPos = WinGetPos( $aLabels[1] ) Local $tRECT = DllStructCreate($tagRECT) DllStructSetData($tRECT, 'Left', 1) DllStructSetData($tRECT, 'Top', 1) DllStructSetData($tRECT, 'Right', $aPos[2]-1) DllStructSetData($tRECT, 'Bottom', $aPos[3]-1) Local $pRECT = DllStructGetPtr($tRECT) Local $aDC[1001] For $i = 1 To 1000 $aDC[$i] = _WinAPI_GetDC($aLabels[$i]) Next Local $hBrush While 1 For $i = 1 To 1000 $hBrush = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "INT", "0x" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2))[0] DllCall("user32.dll", "int", "FillRect", "handle", $aDC[$i], "struct*", $pRECT, "handle", $hBrush) DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hBrush) Next WEnd For $i = 1 To 1000 _WinAPI_ReleaseDC($aLabels[$i], $aDC[$i]) Next1 point
-
Correct... sorry Edit I see, StringFormat is effectively the good way #include<array.au3> $sString = "B|A|1234567890123|C|100111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" $a = StringSplit($sString, "|") Local $b[$a[0]+1][2] For $i = 1 To $a[0] $b[$i][0] = $a[$i] $b[$i][1] = StringFormat("%010d", StringLen($a[$i])) &"_"& $a[$i] Next ;_ArrayDisplay($b) _ArraySort($b, 0, 1, 0, 1) For $i = 1 To $a[0] $a[$i] = $b[$i][0] Next _ArrayDisplay($a)1 point