Leaderboard
Popular Content
Showing content with the highest reputation on 01/31/2018 in all areas
-
Quite large? Seriously? Such a file would be 3,940,649,673,949,170 bytes long, circa 3.5 Pb (Petabytes).3 points
-
how to create a file with all possible hex string combinations
asiawatcher and one other reacted to Jos for a topic
Is there a difference? Jos2 points -
Au3Builder, As previously stated, we are going to lock each and every thread that asks this question as the answer is always the same: when Jon thinks it is time. M23 P.S. But all good things come to those that wait.....1 point
-
VBA Nothing / _Excel_RangeFind()
Moonscarlet reacted to Juvigy for a topic
This is what i used in the past for VBS "nothing" needs: Local $oVBS = ObjCreate("ScriptControl") $oVBS.language = "VBScript" Global Const $Nothing = $oVBS.eval("Nothing") $oVBS = $Nothing If anyone truly needs it1 point -
All, Thanks for giving me the tracks to solve it. In the UDF the loop to walk thru the tree does not work. Just using _GUICtrlTreeView_GetNext instead of _SendMessage($hWnd, $TVM_GETNEXTITEM, $TVGN_NEXT.. make the trick. So here is a simple fix. But on large tree t is not optimised. it sorts all single leaves of the tree. ; #FUNCTION# ==================================================================================================================== ; Author ........: Gary Frost (gafrost) ; Modified.......: mlipok, guinness, gillesg ; First fix not optimized =============================================================================================================================== Func _GUICtrlTreeView_Sort2($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $iItemCount = _GUICtrlTreeView_GetCount($hWnd) If $iItemCount Then Local $aTreeView[$iItemCount], $hItem = 0, $i=0 ; Walk through TreeView items Local $hHandle = _GUICtrlTreeView_GetFirstItem($hWnd) While 1 ; Add item to array $aTreeView[$i] = $hHandle ; increase count $i += 1 ; Move to next item $hHandle = _GUICtrlTreeView_GetNext($hWnd, $hHandle) ; Exit if at end If $hHandle = 0 Then ExitLoop WEnd Local $hChild = 0, $iRecursive = 1 _SendMessage($hWnd, $TVM_SORTCHILDREN, $iRecursive, 0, 0, "wparam", "handle") ; Sort the items in root For $i = 0 To $iItemCount - 1 _SendMessage($hWnd, $TVM_SORTCHILDREN, $iRecursive, $aTreeView[$i], 0, "wparam", "handle") ; Sort the items in root Do ; Sort all child items $hChild = _SendMessage($hWnd, $TVM_GETNEXTITEM, $TVGN_CHILD, $hItem, 0, "wparam", "handle", "handle") If $hChild Then _SendMessage($hWnd, $TVM_SORTCHILDREN, $iRecursive, $hChild, 0, "wparam", "handle") EndIf $hItem = $hChild Until $hItem = 0x00000000 Next EndIf EndFunc ;==>_GUICtrlTreeView_Sort2 On large tree we can reduce trasticly the number of sort orders sent. ; #FUNCTION# ==================================================================================================================== ; Author ........: Gary Frost (gafrost) ; Modified.......: mlipok, guinness, gillesg ; Ths time optimized =============================================================================================================================== Func _GUICtrlTreeView_Sort3($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $iItemCount = _GUICtrlTreeView_GetCount($hWnd) If $iItemCount Then Local $aTreeView[$iItemCount], $i=0 ; get only A child at each level Local $hHandle = _GUICtrlTreeView_GetFirstItem($hWnd) $aTreeView[1]=$hHandle $aTreeView[0]=2 __GUICtrlTreeView_SortGetFirstChild($hWnd, $hHandle, $aTreeView ) redim $aTreeView[$aTreeView[0]] $aTreeView[0]=0 ConsoleWrite(_ArrayToString($aTreeView,@CRLF)&@CRLF) for $i =0 to UBound($aTreeView) -1 _SendMessage($hWnd, $TVM_SORTCHILDREN, 0, $aTreeView[$i], 0, "wparam", "handle") ; Sort the items in root NExt EndIf EndFunc ;==>_GUICtrlTreeView_Sort3 func __GUICtrlTreeView_SortGetFirstChild($hWnd, $hItem, byref $aTreeView) Local $hChild = _GUICtrlTreeView_GetFirstChild($hWnd, $hItem) if $hChild <> 0 then $aTreeView[$aTreeView[0] ]= $hChild $aTreeView[0]+=1 __GUICtrlTreeView_SortGetFirstChild($hWnd,$hChild,$aTreeView) EndIf local $hNext = _GUICtrlTreeView_GetNextSibling($hWnd, $hItem) if $hNext <> 0 then __GUICtrlTreeView_SortGetFirstChild($hWnd,$hnext,$aTreeView) EndFunc on the 2 examples given On example 1 - Solution 1 : 4 order messages sent Solution 2 : 1 order message sent On example 2 Solution 1 : 28 order messages sent Solution 2 : 13 order messages sent Hope it helps to fix the UDF. Gillesg1 point
-
ArraySearch and ArrayDelete help
232showtime reacted to Subz for a topic
Maybe something like below will give you better results: #include <Array.au3> #include <File.au3> Local $sError = "" Local $aFileList = _FileListToArrayRec("C:\Users", "TileDataLayer||Default", $FLTAR_FOLDERS + $FLTAR_NOHIDDEN + $FLTAR_NOSYSTEM, $FLTAR_RECUR, $FLTAR_FASTSORT, $FLTAR_FULLPATH) Switch @error Case 1 $sError = " - Path not found or invalid" Case 2 $sError = " - Invalid Include parameter" Case 3 $sError = " - Invalid Exclude parameter" Case 4 $sError = " - Invalid Exclude_Folders parameter" Case 5 $sError = " - Invalid $iReturn parameter" Case 6 $sError = " - Invalid $iRecur parameter" Case 7 $sError = " - Invalid $iSort parameter" Case 8 $sError = " - Invalid $iReturnPath parameter" Case 9 $sError = " - No files/folders found" EndSwitch If $sError <> "" Then MsgBox(32, "Error", $sError) _ArrayDisplay($aFileList)1 point -
jQuerify a web page (injecting jQuery)
argumentum reacted to Gianni for a topic
Hello, I've modified a bit the script to chek the IE version and use appropriate commands to get reference to the javascript eval() function. At the moment I've access only to an IE version 11 and I can not test if it works on IE < 11 Could someone please check if this script is working on IE versions lesser than 11. It should inject jquery (if not already present in the page), show the jquery version (injected or already present) and use jquery to make the google logo disappear from the page (just for a test). Thanks for the help #include <ie.au3> Example() Func Example() Local $oIE = _IECreate("www.google.com") Local $jQuery = _jQuerify($oIE) MsgBox(0, "Version", "jQuery version: " & $jQuery.fn.jquery) MsgBox(0, "Example", "click ok to exit." & @CRLF & "Google logo will fade out by jQuery...") $jQuery('#hplogo').fadeOut(3000) ; jQuery will fade out the google logo EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $msie, $jsEval, $jQuery, $otherlib = False $msie = Execute('$oIE.document.documentMode') If ($msie = "") Or Number($msie) < 11 Then ; an IE version < 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('window.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.parentwindow.eval') Until IsObj($jsEval) Else ; IE version > = 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) EndIf ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = 'https://code.jquery.com/jquery-latest.min.js' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify1 point -
I've released v0.1.8, which includes: Improved function signature helpers Parameter position in function has much-improved detection (no longer tripped up by commas in quotes) Help for nested functions now work Parameter descriptions have been upgraded with Markdown for better styling and layout Upgraded many snippets to Completions VS Marketplace Link Star/Submit Issues on Github1 point