Leaderboard
Popular Content
Showing content with the highest reputation on 03/03/2015 in all areas
-
concur, use manadar's stuff, I edited his example to perform your task ; Authors: Manadar, GarryFrost ; Contributor: WideBoyDixon #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Array.au3> #include-once Dim $hHook Dim $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") Dim $hmod = _WinAPI_GetModuleHandle(0) Dim $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) Dim $buffer = "" Dim $hotstrings[1] Dim $hotfuncs[1] Dim $hWnd = GUICreate("") GUIRegisterMsg($WM_KEYDOWN, "_GUIKeyProc") ;; ========================== ;; This is your actual script. ;; ========================== ;#include <HotString.au3> HotStringSet("mda","examplefunction") While 1 Sleep(10) WEnd Func examplefunction() Send("{BACKSPACE 3}") Send("My Dear Alan: ") EndFunc ;; ========================== ;; End of actual script. ;; The part above the start of the actual script ;; and below this comment ;; script can be put in another ;; file and included. ;; ========================== Func HotStringSet($hotstring, $func) _ArrayAdd($hotstrings, $hotstring) _ArrayAdd($hotfuncs, $func) EndFunc Func EvaluateKey($keycode) If (($keycode > 64) And ($keycode < 91)) _ ; A - Z Or (($keycode > 47) And ($keycode < 58)) Then ; 0 - 9 $buffer &= Chr($keycode) $buffer = StringRight($buffer, 50) _CheckHotkeys($buffer) EndIf EndFunc ;==>EvaluateKey Func _CheckHotkeys($s) For $i = 0 to UBound($hotstrings)-1 if ( $hotstrings[$i] = StringRight($s, StringLen($hotstrings[$i])) ) Then Call($hotfuncs[$i]) EndIf Next EndFunc Func _GUIKeyProc($hWnd, $Msg, $wParam, $lParam) EvaluateKey(Number($wParam)) EndFunc ;=========================================================== ; callback function. This function must return as quickly as possible or it will stall and block user input ;=========================================================== Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndIf If $wParam = $WM_KEYDOWN Then $vkKey = DllStructGetData($tKEYHOOKS, "vkCode") _WinAPI_PostMessage($hWnd, $WM_KEYDOWN, $vkKey, 0) EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>_KeyProc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) EndFunc ;==>OnAutoItExit2 points
-
Another way to delete multiple comas within multiple double quotes. $string = '"this,is,a,test",3/1/15 11:49:11 AM,COMPUTER01,10.0.0.6,User-defined Rules:test .10,deny read,"\Device\HarddiskVolumeShadowCopy3455\Applications\APPS\Test\shared\driving\predrivingscreening\AArchive\Shiller,Ron,09\INSTRUCTION.TXT",,_,10.110.69.16,C:\Program Files\Veritas\NetBackup\bin\bpbkar32.exe,",",' & "'File' class or access,Notice,OAS,My Organization\Servers\Servers\,1092" ; Result= "thisisatest",3/1/15 11:49:11 AM,COMPUTER01,10.0.0.6,User-defined Rules:test .10,deny read,"\Device\HarddiskVolumeShadowCopy3455\Applications\APPS\Test\shared\driving\predrivingscreening\AArchive\ShillerRon09\INSTRUCTION.TXT",,_,10.110.69.16,C:\Program Files\Veritas\NetBackup\bin\bpbkar32.exe,"",'File' class or access,Notice,OAS,My Organization\Servers\Servers\,1092 $string = Execute('"' & StringRegExpReplace($string, '(".+?")', '" & StringReplace(""\1"",",","") & "') & '"') ConsoleWrite($string & @LF)2 points
-
HtmLayout DLL UDF !
guiltyking reacted to GMib for a topic
I finally managed to run HtmLayout.dll, HtmLayout is a fast, lightweight and embeddable HTML/CSS renderer and layout manager component. Download dll here : http://www.terrainformatica.com/htmlayout/HTMLayoutDLL.zip #include <WinAPI.au3> #include <WindowsConstants.au3> #include <HtmLayout Constants.au3> #include-once Global $aHLelementsfound = 0 Global $HtmLayoutdll = 0 Global $HtmLayoutRef = 0 Global $HandleWindowsAttachEvent = 0 Global $HtmLayoutEvHandler = 0 Global $aHLDOM_error[7] $aHLDOM_error[0] = "function completed successfully" $aHLDOM_error[1] = "invalid HWND" $aHLDOM_error[2] = "invalid HELEMENT" $aHLDOM_error[3] = "attempt to use HELEMENT which is not marked by HTMLayout_UseElement()" $aHLDOM_error[4] = "parameter is invalid, e.g. pointer is null" $aHLDOM_error[5] = "operation failed, e.g. invalid html in HTMLayoutSetElementHtml()" $aHLDOM_error[6] = "Dllcall error" ; #FUNCTION# ==================================================================================================== ; Name...........: _HLStartup ; Description....: Initialize HtmLayout ; Syntax.........: _HLStartup($dll = "HtmLayout.dll") ; Parameters.....: $dll - Path to HtmLayout DLL [Optional] ; ; Return values..: Success - 1 ; Failure - 0 ; Remarks........: ; =============================================================================================================== Func _HLStartup($dll = "HtmLayout.dll") $HtmLayoutRef += 1 If $HtmLayoutRef > 1 Then Return 1 $HtmLayoutdll = DllOpen($dll) If $HtmLayoutdll = -1 Then Return SetError(1, 0, 0) Return 1 EndFunc ; #FUNCTION# ==================================================================================================== ; Name...........: _HLCreateGui ; Description....: Create HtmLayout Windows ; Syntax.........: _HLCreateGui($ParentGui, $x = 0, $y = 0, $w = 100, $h = 50) ; Parameters.....: $ParentGui - Handle of parent Gui ; $x - [Optional] ; $y - [Optional] ; $w - [Optional] ; $h - [Optional] ; ; Return values..: Success - HTMLayout window handle. ; Failure - 0 ; Remarks........: ; =============================================================================================================== Func _HLCreateGui($ParentGui, $x = 0, $y = 0, $w = 100, $h = 50) $result = DllCall($HtmLayoutdll, "wstr", "HTMLayoutClassNameW") If @error Then Return 0 $ClassName = $result[0] $HtmLayoutHwnd = _WinAPI_CreateWindowEx(0, $ClassName, "", BitOR($WS_CHILD, $WS_VISIBLE, $WS_CLIPCHILDREN), $x, $y, $w, $h, $ParentGui) Return $HtmLayoutHwnd EndFunc ;==>_HLCreateGui ; #FUNCTION# ==================================================================================================== ; Name...........: _HLLoadFile ; Description....: Load HTML file. ; Syntax.........: _HLLoadFile($HLHwnd, $file) ; Parameters.....: $HLHwnd - HTMLayout window handle. ; $file - File name of an HTML file. ; ; Return values..: Success - 1 ; Failure - 0 ; Remarks........: ; =============================================================================================================== Func _HLLoadFile($HLHwnd, $file) $result = DllCall($HtmLayoutdll, "BOOL", "HTMLayoutLoadFile", "HWND", $HLHwnd, "wstr", $file) Return $result[0] EndFunc ;==>_HLLoadFile ; #FUNCTION# ==================================================================================================== ; Name...........: _HLLoadHtml ; Description....: Load HTML from memory. ; Syntax.........: _HLLoadHtml($HLHwnd, $String) ; Parameters.....: $HLHwnd - HTMLayout window handle. ; $String - HTML to load. ; ; Return values..: Success - 1 ; Failure - 0 ; Remarks........: ; =============================================================================================================== Func _HLLoadHtml($HLHwnd, $String) $StringSize = StringLen($String) $result = DllCall($HtmLayoutdll, "BOOL", "HTMLayoutLoadHtml", "HWND", $HLHwnd, "str", $String, "UINT", $StringSize) Return $result[0] EndFunc ;==>_HLLoadHtml ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetRootElement ; Description....: Get root DOM element of HTML document. ; Syntax.........: _HLGetRootElement($HLHwnd) ; Parameters.....: $HLHwnd - HTMLayout window handle. ; ; Return values..: Success - Return root element. ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: Root DOM object is always a 'HTML' element of the document. ; =============================================================================================================== Func _HLGetRootElement($HLHwnd) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetRootElement", "HWND", $HLHwnd, "ptr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetRootElement ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetChildrenCount ; Description....: Get number of child elements. ; Syntax.........: _HLGetChildrenCount($el) ; Parameters.....: $el - DOM element handle which child elements you need to count ; ; Return values..: Success - Return number of child elements ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetChildrenCount($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetChildrenCount", "ptr", $el, "UINT*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetChildrenCount ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetNthChild ; Description....: Get handle of Nth child element. ; Syntax.........: _HLGetNthChild($el, $nth) ; Parameters.....: $el - DOM element handle ; $nth - number of the child element ; ; Return values..: Success - Return handle of the child element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetNthChild($el, $nth) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetNthChild", "ptr", $el, "UINT", $nth-1, "ptr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[3] EndFunc ;==>_HLGetNthChild ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetParentElement ; Description....: Get parent element. ; Syntax.........: _HLGetParentElement($el) ; Parameters.....: $el - DOM element handle which parent you need ; ; Return values..: Success - Return handle of the parent element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetParentElement($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetParentElement", "ptr", $el, "ptr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetParentElement ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetElementHtml ; Description....: Get Html of the element. ; Syntax.........: _HLGetElementHtml($el, $outer = 1) ; Parameters.....: $el - DOM element handle ; $outer - BOOL, if TRUE will return outer HTML otherwise inner. [Optional] ; ; Return values..: Success - Return Html of element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetElementHtml($el, $outer = 1) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetElementHtml", "ptr", $el, "str*", "", "BOOL", $outer) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetElementHtml ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetElementInnerText ; Description....: Get inner text of the element. ; Syntax.........: _HLGetElementInnerText($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return innertext of element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetElementInnerText($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetElementInnerText", "ptr", $el, "str*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetElementInnerText ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSetElementInnerText ; Description....: Set inner text of the element. ; Syntax.........: _HLSetElementInnerText($el, $String) ; Parameters.....: $el - DOM element handle ; $String - Innertext ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLSetElementInnerText($el, $String) $len = StringLen($String) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSetElementInnerText", "ptr", $el, "str", $String, "UINT", $len) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLSetElementInnerText ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetAttributeCount ; Description....: Get number of element's attributes. ; Syntax.........: _HLGetAttributeCount($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return number of element attributes. ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetAttributeCount($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetAttributeCount", "ptr", $el, "UINT*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetAttributeCount ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetNthAttribute ; Description....: Get value of any element's attribute by attribute's number. ; Syntax.........: _HLGetNthAttribute($el, $nth) ; Parameters.....: $el - DOM element handle ; $nth - number of desired attribute ; ; Return values..: Success - Return Array with name and value of attribute. $return[0] = name, $return[1] = value ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetNthAttribute($el, $nth) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetNthAttribute", "ptr", $el, "UINT", $nth, "str*", "", "wstr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Dim $aRet[2] $aRet[0] = $result[3] $aRet[1] = $result[4] Return $aRet EndFunc ;==>_HLGetNthAttribute ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetAttributeByName ; Description....: Get value of any element's attribute by name. ; Syntax.........: _HLGetAttributeByName($el, $AttName) ; Parameters.....: $el - DOM element handle ; $AttName - attribute name ; ; Return values..: Success - Return attribute value ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetAttributeByName($el, $AttName) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetAttributeByName", "ptr", $el, "str", $AttName, "wstr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[3] EndFunc ;==>_HLGetAttributeByName ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSetAttributeByName ; Description....: Set attribute's value. ; Syntax.........: _HLSetAttributeByName($el, $AttName, $value) ; Parameters.....: $el - DOM element handle ; $AttName - attribute name ; $value - new attribute value or 0 if you want to remove attribute. ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLSetAttributeByName($el, $AttName, $value) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSetAttributeByName", "ptr", $el, "str", $AttName, "wstr", $value) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLSetAttributeByName ; #FUNCTION# ==================================================================================================== ; Name...........: _HLClearAttributes ; Description....: Remove all attributes from the element. ; Syntax.........: _HLClearAttributes($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLClearAttributes($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutClearAttributes", "ptr", $el) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLClearAttributes ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetElementIndex ; Description....: Get element index. ; Syntax.........: _HLGetElementIndex($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return index of element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetElementIndex($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetElementIndex", "ptr", $el, "UINT*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetElementIndex ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetElementType ; Description....: Get element's type. ; Syntax.........: _HLGetElementType($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return Type of element ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetElementType($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetElementType", "ptr", $el, "str*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[2] EndFunc ;==>_HLGetElementType ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetStyleAttribute ; Description....: Get element's style attribute. ; Syntax.........: _HLGetStyleAttribute($el, $StyleName) ; Parameters.....: $el - DOM element handle ; $StyleName - name of the style attribute ; ; Return values..: Success - Return value of the style attribute. ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLGetStyleAttribute($el, $StyleName) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetStyleAttribute", "ptr", $el, "wstr", $StyleName, "wstr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[3] EndFunc ;==>_HLGetStyleAttribute ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSetStyleAttribute ; Description....: Set element's style attribute. ; Syntax.........: _HLSetStyleAttribute($el, $StyleName, $StyleValue) ; Parameters.....: $el - DOM element handle ; $StyleName - name of the style attribute ; $StyleValue - value of the style attribute. ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLSetStyleAttribute($el, $StyleName, $StyleValue) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSetStyleAttribute", "ptr", $el, "str", $StyleName, "wstr", $StyleValue) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLSetStyleAttribute ; #FUNCTION# ==================================================================================================== ; Name...........: _HLVisitElements ; Description....: Return Array of elements in a DOM that meets specified criteria. ; Syntax.........: _HLVisitElements($el, $TagName = "", $AttributeName = "", $AttributeValue = "", $depth = 0) ; Parameters.....: $el - DOM element handle ; $TagName - comma separated list of tag names to search, e.g. "div", "p", "div,p" etc. [Optional] ; $AttributeName - name of attribute, can contain wildcard characters. [Optional] ; $AttributeValue - value of attribute, can contain wildcard characters.[Optional] ; $depth - 0 means all descendants, 1 - direct children only, 2 - children and their children and so on. [Optional] ; ; Return values..: Success - Return array of element, $return[0] : number of element. ; Failure - Return 0 if no element found else Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLVisitElements($el, $TagName = "", $AttributeName = "", $AttributeValue = "", $depth = 0) $TagType = "str" $AttType = "str" $AttVType = "wstr" If $TagName = "" Then $TagType = "ptr" If $AttributeName = "" Then $AttType = "ptr" If $AttributeValue = "" Then $AttVType = "ptr" $handle = DllCallbackRegister("_HLElementsCallback", "BOOL", "ptr;ptr") Dim $aHLelementsfound[1] $result = DllCall($HtmLayoutdll, "int", "HTMLayoutVisitElements", "ptr", $el, $TagType, $TagName, $AttType, $AttributeName, $AttVType, $AttributeValue, "ptr", DllCallbackGetPtr($handle), "ptr", "", "DWORD", $depth) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) DllCallbackFree($handle) $HLelementsCount = UBound($aHLelementsfound) If $HLelementsCount = 1 Then Return 0 $aHLelementsfound[0] = $HLelementsCount-1 Return $aHLelementsfound EndFunc ;==>_HLVisitElements Func _HLElementsCallback($el, $param) Local $iUBound = UBound($aHLelementsfound) ReDim $aHLelementsfound[$iUBound + 1] $aHLelementsfound[$iUBound] = $el EndFunc ;==>_HLElementsCallback ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSelectElements ; Description....: Return Array of elements in a DOM that meets specified CSS selectors. ; Syntax.........: _HLSelectElements($el, $CssSel) ; Parameters.....: $el - DOM element handle ; $CssSel - comma separated list of CSS selectors, e.g.: div, id, div[align="right"]. ; ; Return values..: Success - Return Array of elements, $return[0] : number of element. ; Failure - Return 0 if no element found else Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: See list of supported selectors: http://terrainformatica.com/htmlayout/selectors.whtm ; =============================================================================================================== Func _HLSelectElements($el, $CssSel) $handle = DllCallbackRegister("_HLElementsCallback", "BOOL", "ptr;ptr") Dim $aHLelementsfound[1] $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSelectElements", "ptr", $el, "str", $CssSel, "ptr", DllCallbackGetPtr($handle), "ptr", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) DllCallbackFree($handle) $HLelementsCount = UBound($aHLelementsfound) If $HLelementsCount = 1 Then Return 0 $aHLelementsfound[0] = $HLelementsCount-1 Return $aHLelementsfound EndFunc ;==>_HLSelectElements ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSelectParent ; Description....: Find parent of the element by CSS selector. ; Syntax.........: _HLSelectParent($el, $CssSel, $depth = 0) ; Parameters.....: $el - DOM element handle ; $CssSel - comma separated list of CSS selectors, e.g.: div, id, div[align="right"]. ; $depth - if depth == 1 then it will test only element itself. ; Use depth = 1 if you just want to test he element for matching given CSS selector(s). ; depth = 0 will scan the whole child parent chain up to the root. [Optional] ; ; Return values..: Success - Return parent of the element. ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: ; =============================================================================================================== Func _HLSelectParent($el, $CssSel, $depth = 0) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSelectParent", "ptr", $el, "str", $CssSel, "UINT", $depth, "ptr*", "") If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return $result[4] EndFunc ;==>_HLSelectParent ; #FUNCTION# ==================================================================================================== ; Name...........: _HLSetElementHtml ; Description....: Set inner or outer html of the element. ; Syntax.........: _HLSetElementHtml($el, $html, $where) ; Parameters.....: $el - DOM element handle ; $html - string containing html text ; $where - possible values are: ; 0: replace content of the element ; 1: insert html before first child of the element ; 2: insert html after last child of the element ; 3: replace element by html, a.k.a. element.outerHtml = "something" ; 4: insert html before the element ; 5: insert html after the element ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: Value 3,4 and 5 for $where do not work for inline elements like ; =============================================================================================================== Func _HLSetElementHtml($el, $html, $where) $htmllen = StringLen($html) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutSetElementHtml", "ptr", $el, "str", $html, "DWORD", $htmllen, "UINT", $where) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLSetElementHtml ; #FUNCTION# ==================================================================================================== ; Name...........: _HLDeleteElement ; Description....: Delete element. ; Syntax.........: _HLDeleteElement($el) ; Parameters.....: $el - DOM element handle ; ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: After call to this function $el will become invalid. ; =============================================================================================================== Func _HLDeleteElement($el) $result = DllCall($HtmLayoutdll, "int", "HTMLayoutDeleteElement", "ptr", $el) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) Return 1 EndFunc ;==>_HLDeleteElement ;~ EXTERN_C HLDOM_RESULT HLAPI HTMLayoutShowPopup (HELEMENT hePopup, HELEMENT heAnchor, UINT placement) ;~ Shows block element (DIV) in popup window. ;~ Func _HLShowPopup($HtmLayoutdll, $el, $anchor, $placement) ;~ $result = DllCall($HtmLayoutdll, "int", "HTMLayoutShowPopup", "ptr", $el, "ptr", $anchor, "UINT", $placement) ;~ If @error Then Return 0 ;~ Return 1 ;~ EndFunc ; #FUNCTION# ==================================================================================================== ; Name...........: _HLWindowAttachEventHandler ; Description....: Attach/Detach ElementEventProc to the htmlayout window. ; Syntax.........: _HLWindowAttachEventHandler($hwnd, $func) ; Parameters.....: $hwnd - HWND of HtmLayout windows ; $func - Function to receive events (need two params eg: $func($ev, $prm) ; $events - Events you want receive (see remarks) ; Return values..: Success - Return 1 ; Failure - Return -1, @error is set. (see $aHLDOM_error[@error] for details) ; Remarks........: _HLGetParam must use for read param of event. ;~ Events can be : ;~ $HANDLE_INITIALIZATION : attached/detached ;~ $HANDLE_MOUSE : mouse events ;~ $HANDLE_KEY : key events ;~ $HANDLE_FOCUS : focus events, if this flag is set it also means that element it attached to is focusable ;~ $HANDLE_SCROLL : scroll events ;~ $HANDLE_SIZE : size changed event ;~ $HANDLE_DATA_ARRIVED : requested data () has been delivered ;~ $HANDLE_BEHAVIOR_EVENT : secondary, synthetic events: ;~ BUTTON_CLICK, HYPERLINK_CLICK, etc., ;~ a.k.a. notifications from intrinsic behaviors ;~ $HANDLE_METHOD_CALL : behavior specific methods ;~ $HANDLE_EXCHANGE : system drag-n-drop events ;~ $HANDLE_ALL : all of them ; =============================================================================================================== Func _HLWindowAttachEventHandler($hwnd, $func, $events) $HandleWindowsAttachEvent = DllCallbackRegister("HLEvHandler", "BOOL", "ptr;ptr;UINT;ptr") $result = DllCall($HtmLayoutdll, "int", "HTMLayoutWindowAttachEventHandler", "HWND", $hwnd, "ptr", DllCallbackGetPtr($HandleWindowsAttachEvent), "ptr", "", "UINT", $DISABLE_INITIALIZATION+$events) If @error Then Return SetError(6,0,-1) If $result[0] <> 0 Then SetError($result[0],0,-1) $HtmLayoutEvHandler = $func Return 1 EndFunc ;==>_HLWindowAttachEventHandler Func HLEvHandler($tag,$el,$ev,$prm) $a = DllStructCreate("UINT cmd", $prm) $cmd = DllStructGetData($a, "cmd") $a = 0 If $cmd > 32768 Then Return Execute ($HtmLayoutEvHandler&"("&$ev&","&$prm&")") EndFunc ; #FUNCTION# ==================================================================================================== ; Name...........: _HLGetParam ; Description....: Get parameter of events ; Syntax.........: _HLGetParam($ev, $prm) ; Parameters.....: $ev - Type of event see remarks of _HLWindowAttachEventHandler ; $prm - Parameter of event ; ; Return values..: Success - return an array depending of event ; Failure - Return -1 ; Remarks........: For Uppercase type see "HtmLayout Constants.au3" ; $HANDLE_MOUSE : $ret[12]=[MOUSE_EVENTS, target el, curs xpos el rel, curs ypos el rel, curs xpos doc rel, curs ypos doc rel, MOUSE_BUTTONS, KEYBOARD_STATES, CURSOR_TYPE, is on icon, el dragged, DRAGGING_TYPE] ; $HANDLE_KEY : $ret[4]=[KEY_EVENTS, target el, key code, KEYBOARD_STATES] ; $HANDLE_FOCUS : $ret[4]=[FOCUS_EVENTS, target el, focus by click, cancel] ; $HANDLE_SCROLL: $ret[4]=[SCROLL_EVENTS, target el, scroll pos, 1 if vert scroll] ; $HANDLE_BEHAVIOR_EVENT : $ret[5]=[BEHAVIOR_EVENTS, target el, source el, EVENT_REASON or EDIT_CHANGED_REASON, data] ;=============================================================================================================== Func _HLGetParam($ev, $prm) Local $ap = -1 If $ev = $HANDLE_MOUSE Then $str = "UINT cmd;ptr target;DWORD posx;DWORD posy;DWORD pos_documentx;DWORD pos_documenty;UINT button_state;UINT alt_state;UINT cursor_type;BOOL is_on_icon;ptr dragging;UINT dragging_mode" $ap = getstructdata($str,$prm) EndIf If $ev = $HANDLE_KEY Then $str = "UINT cmd;ptr target;UINT key_code;UINT alt_state" $ap = getstructdata($str,$prm) EndIf If $ev = $HANDLE_FOCUS Then $str = "UINT cmd;ptr target;BOOL by_mouse_click;BOOL cancel" $ap = getstructdata($str,$prm) EndIf If $ev = $HANDLE_SCROLL Then $str = "UINT cmd;ptr target;int pos;BOOL vertical" $ap = getstructdata($str,$prm) EndIf If $ev = $HANDLE_BEHAVIOR_EVENT Then $str = "UINT cmd;ptr heTarget;ptr he;UINT reason;ptr data" $ap = getstructdata($str,$prm) EndIf If $ev = $HANDLE_METHOD_CALL Then $str = "UINT cmd;ptr heTarget;ptr he;UINT reason;ptr data" $ap = getstructdata($str,$prm) EndIf Return $ap EndFunc Func getstructdata($str,$prm) $a = DllStructCreate($str, $prm) $b = StringSplit ( $str, ";") Dim $ret[$b[0]] For $i = 0 To $b[0]-1 $ret[$i] = DllStructGetData($a,$i+1) Next Return $ret EndFunc Edit: add some function. User calltips : _HLStartup ($dll = "HtmLayout.dll") Initialize HtmLayout (required: #include <HtmLayout UDF.au3>) _HLCreateGui ($ParentGui, $x = 0, $y = 0, $w = 100, $h = 50) Create HtmLayout Windows (required: #include <HtmLayout UDF.au3>) _HLLoadFile ($HLHwnd, $file) Load HTML file. (required: #include <HtmLayout UDF.au3>) _HLLoadHtml ($HLHwnd, $String) Load HTML from memory. (required: #include <HtmLayout UDF.au3>) _HLGetRootElement ($HLHwnd) Get root DOM element of HTML document. (required: #include <HtmLayout UDF.au3>) _HLGetChildrenCount ($el) Get number of child elements. (required: #include <HtmLayout UDF.au3>) _HLGetGetFocusElement ($hwnd) Get focused DOM element of HTML document. (required: #include <HtmLayout UDF.au3>) _HLGetGetElementState ($el) Get state bits, see ELEMENT_STATE_BITS in "HtmLayout constats.au3" (required: #include <HtmLayout UDF.au3>) _HLSetElementState ($el, $stateToSet, $stateToClear = 0, $upt = 1) Set state bits, see ELEMENT_STATE_BITS in "HtmLayout constats.au3" (required: #include <HtmLayout UDF.au3>) _HLGetNthChild ($el, $nth) Get handle of Nth child element. (required: #include <HtmLayout UDF.au3>) _HLGetParentElement ($el) Get parent element. (required: #include <HtmLayout UDF.au3>) _HLGetElementHtml ($el, $outer = 1) Get Html of the element. (required: #include <HtmLayout UDF.au3>) _HLGetElementInnerText ($el) Get inner text of the element. (required: #include <HtmLayout UDF.au3>) _HLSetElementInnerText ($el, $String) Set inner text of the element. (required: #include <HtmLayout UDF.au3>) _HLGetAttributeCount ($el) Get number of element's attributes. (required: #include <HtmLayout UDF.au3>) _HLGetNthAttribute ($el, $nth) Get value of any element's attribute by attribute's number. (required: #include <HtmLayout UDF.au3>) _HLGetAttributeByName ($el, $AttName) Get value of any element's attribute by name. (required: #include <HtmLayout UDF.au3>) _HLSetAttributeByName ($el, $AttName, $value) Set attribute's value. (required: #include <HtmLayout UDF.au3>) _HLClearAttributes ($el) Remove all attributes from the element. (required: #include <HtmLayout UDF.au3>) _HLGetElementIndex ($el) Get element index. (required: #include <HtmLayout UDF.au3>) _HLGetElementType ($el) Get element's type. (required: #include <HtmLayout UDF.au3>) _HLGetStyleAttribute ($el, $StyleName) Get element's style attribute. (required: #include <HtmLayout UDF.au3>) _HLSetStyleAttribute ($el, $StyleName, $StyleValue) Set element's style attribute. (required: #include <HtmLayout UDF.au3>) _HLVisitElements ($el, $TagName = "", $AttributeName = "", $AttributeValue = "", $depth = 0) Return Array of elements in a DOM that meets specified criteria. (required: #include <HtmLayout UDF.au3>) _HLSelectElements ($el, $CssSel) Return Array of elements in a DOM that meets specified CSS selectors. (required: #include <HtmLayout UDF.au3>) _HLSelectParent ($el, $CssSel, $depth = 0) Find parent of the element by CSS selector. (required: #include <HtmLayout UDF.au3>) _HLSetElementHtml ($el, $html, $where) Set inner or outer html of the element. (required: #include <HtmLayout UDF.au3>) _HLDeleteElement ($el) Delete element. (required: #include <HtmLayout UDF.au3>) _HLWindowAttachEventHandler ($hwnd, $func) Attach/Detach ElementEventProc to the htmlayout window. (required: #include <HtmLayout UDF.au3>) _HLGetParam ($ev, $prm) Get parameter of events (required: #include <HtmLayout UDF.au3>)HtmLayout UDF.7z1 point -
ActiveWindowTracking Toy v1.0.0.2
coffeeturtle reacted to jaberwacky for a topic
Hello, I don't like clicking every window just to make it the active window. I also often times want a window to be active but not stand on top of other windows. So, I threw together this script which I hope changes the proper windows settings without having to edit the registry. Seems to work for me on my Windows 7 x64 machine. Your mileage may vary. I honor no warranties. A more thorough explanation. Linux systems have a feature which will automatically focus the window that is currently under the mouse cursor. This setting can be enabled in Windows but used to require futzing around in the registry. This tool will enable the setting and also exposes two other important settings. ZOrder will determine whether or not the window which takes focus will come to the fore. Timeout will set how many milliseconds the mouse must hover over a window before it will take focus. ActiveWindowTrack Toy.zip dl: 110 Sincerely yours, Jaberwacky P.S., Latest AutoIt beta required for the source. An exe is included however. ------------------------------------------------------------------ Project now available on GitHub. ------------------------------------------------------------------ Latest update: Better code. No! I need to work with it some more. I messed something up. Latest Update: NOW better code. Latest Update: Improved GUI. Latest Update: The weirdest thing has happened. I was editing the file but when I would zip it, then it seemed like it wasn't creating a new zip file! Anyways, it should be right now. Latest Update: Better project structure. Latest Update: Fixed an important issue where the user could not revert back to previous settings. Again. Latest Update: Fixed again. Latest Update: Version 1.0! Made the GUI bigger in case it was too small for anybody with a disability. If that's ever a problem then let me know. Admin rights aren't actually required so those are gone. No need to restart your computer. Let me know of any problems! Latest update: ZOrder wasn't working. Does now. Latest Update: ZOrder wasn't working. Again. Silly error arising from the ancient copy/paste clan style of coding. ------------------------------------------------------------------ Recommended settings: Leave ZOrder unchecked and set Timeout to 100. Thanks to orbs and JohnOne!1 point -
Is there any better way to do this ?
kcvinu reacted to jaberwacky for a topic
In that case, Manadar has a hotkey udf which should do what you want.1 point -
not an inference, just stating what that code does differently... Do you want that behavior? because if you start your script in post #1 and type "mom and dad" you will get "mom andMy Dear Alan: " if you want it to work as though it is exploding the abbreviation "mda", you may want to look at hotstrings1 point
-
the OP sets "a" to type that string, everytime, after "m" and "d" have been pressed. So thats probably not desirable without setting those flags back to False after the send, requiring them to be subsequent, or requiring all three to be pressed as in Jab's.1 point
-
New SciTE4AutoIt3 available with updated SciTE v3.4.4
jaberwacky reacted to Jos for a topic
Uploaded a new Beta for SciTEConfig with the added caret line background color alpha and changed logic to better replicate the result in the shown labels. Let me know if that works. By the way: I figured I like the 256 setting for both the most. Jos1 point -
Is there any better way to do this ?
kcvinu reacted to jaberwacky for a topic
Here's how I'd do it. Your mileage may vary. #include <Misc.au3> Const $ip_m = "4D" Const $ip_d = "44" Const $ip_a = "41" Do If _IsPressed($ip_m) And _IsPressed($ip_d) And _IsPressed($ip_a) Then TestSend() Do Sleep(100) Until Not _IsPressed($ip_m) Or Not _IsPressed($ip_d) Or Not _IsPressed($ip_a) EndIf Sleep(100) Until False Func TestSend() Send("{BS 3}My Dear Alan{TAB}:{SPACE}") EndFunc1 point -
Ask about the buttons and interface
hoangtungpcinfo reacted to BrewManNH for a topic
I'm guessing you're not getting help because, unfortunately, your question isn't clear. What exactly is the problem you're having? If you're having problems describing it in English, post in your native language and we'll try and translate it. Hopefully that will help.1 point -
Tis done! We'll see, or maybe not. I'll be happy if the changes I made last a year or two. JohnOne, I've made a few further modifications. Anything you want to change back, you know you don't need to ask. I think this has been an interesting and successful experiment, different from the usual coding activities. I hope more things like this will happen in the future with your support. I learned a lot by your participation, and would have done so in any event.1 point
-
GuiCtrlGetState seemingly not returning checkbox state.
jaberwacky reacted to orbs for a topic
from the help of GUICtrlGetState(): As opposed to GUICtrlRead() this function returns ONLY the state of a control enabled/disabled/hidden/show/dropaccepted so use GuiCtrlRead().1 point -
I think you're right. In the past, I have recoded everything before to make it easier. It becomes sloppy when you add new things that you didn't previously account for. It will certainly take a bit of time to recode this demon, so I will return to let you know the results upon completion.1 point
-
TheDcoder, In a perfect world I might well have done so - but I did not. Besides, I find it much easier to deal with whole scripts so that I can run them and see what happens - that way I can adjust things as I go along to confirm that I am on the right track (or not!). Debugging is an art, not an exact science, and I prefer seeing the whole picture. M231 point
-
I'm sure you can copy the code into word and create your own pdf.1 point
-
Well you got it from here: '?do=embed' frameborder='0' data-embedContent>> I believe I've read that he has documentation on how to use it in that thread... have you not found it?1 point
-
Duration of video files
dynamitemedia reacted to TheSaint for a topic
Haven't got my code on hand, but I use the CLI (Command-line) version of Media Info, as the regular won't work. It is a separate download, and sometimes difficult to find, but I either got it through Sourceforge or the Home page. It writes a single entry to a text file, which you can then read. It can be a bit tricky to understand the command-line usage, so tomorrow, if I remember, and you haven't had success yet, I will dig it out and post here. Simpler than wakillon's code, but I'm interested in the DLL method he's used, for I wasn't aware there was another way.1 point -
AutoIt help file isn't meant to be a tutorial: no more for regexps than for, say, the Windows messaging system. When you select a regepx tutorial, prefer one about the PCRE (Perl-Compatible Regular Expressions) flavor, which is what AutoIt uses.1 point
-
automatically move mouse and click, program?
sdfaheemuddin reacted to caramen for a topic
I whould prefer using the AU3 record script "in extra folder" it s more faster easy use1 point -
Another veri good text extraction commandline utility.. http://www.cross-plus-a.com/btext.htm I think that it's not necesary to create new topic about it.. I want just let you know..1 point
-
The forum is the very good way to learn : search for regex and open topics, then try to understand the code. You can also try your expressions with an online regex tester like regex101.com which explain in details the expression content. This web site contains a Community tab with a lot of examples.1 point
-
This is also a great resource: http://www.regular-expressions.info/ But regexone.com seems rather to the point as well.1 point
-
First of all: The search function of the forum is your friend Looking for "Regular Expressions tutorial" showed up a lot of threads including >this one. Should at least be a good starting point.1 point
-
Ask about the buttons and interface
hoangtungpcinfo reacted to BrewManNH for a topic
Remove the following lines from your script. Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") ;-Exit And change your Switch statement to this: Switch $msg Case $button1 ShellExecute("https://facebook.com") Case $button2 ShellExecute("http://sinhvienit.net") Case $GUI_EVENT_CLOSE ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Exit EndSwitch You can NOT use OnEvent mode and messageloop mode in the same script without some coding gymnastics.1 point -
@kcvinu you can click in the function name that I posted (I searched in the help file index for "stringRegExp" and was found)1 point
-
XML config file
mLipok reacted to johnmcloud for a topic
mLipok, The first website to check is Internet Archive: Wayback Machine #include-once ; #INDEX# ======================================================================== ; Title .........: _ConfigIO ; AutoIt Version : 3.3.0++ ; Language ......: English ; Description ...: Functions that assist with reading and writiing configuration files. A very simple XML reader/writer. ; Author ........: Stephen Podhajecki (eltorro) ; ================================================================================ ; #VARIABLES# ==================================================================== Global $__COM_ERR Global Const $NODE_XML_INVALID = 0; Global Const $NODE_XML_ELEMENT = 1; Global Const $NODE_XML_ATTRIBUTE = 2; Global Const $NODE_XML_TEXT = 3; Global Const $NODE_XML_CDATA_SECTION = 4; Global Const $NODE_XML_ENTITY_REFERENCE = 5; Global Const $NODE_XML_ENTITY = 6; Global Const $NODE_XML_PROCESSING_INSTRUCTION = 7; Global Const $NODE_XML_COMMENT = 8; Global Const $NODE_XML_DOCUMENT = 9; Global Const $NODE_XML_DOCUMENT_TYPE = 10; Global Const $NODE_XML_DOCUMENT_FRAGMENT = 11; Global Const $NODE_XML_NOTATION = 12; Global $XML_ENCODING[4] = [3, "iso-8859-1", "UTF-8", "UTF-16"] ; the first element sets the default encoding Global $aCONFIG_FHDS[1][2] ;hold handles and filenames ; ================================================================================ ; #NO_DOC_FUNCTION# ============================================================== ; Not working/documented/implimented at this time ; ================================================================================ ; __Config_COMErr ; ================================================================================ ; #CURRENT# ====================================================================== ;_Config_Create ;_Config_Open ;_Config_Read ;_Config_Write ;_Config_Delete ;_Config_EnumParam ;_Config_EnumVal ;_Config_Save ;_Config_SaveAs ;_Config_Close ;_Config_Indent ;_Config_Base64_Encode ;_Config_Base64_Decode ; ================================================================================ ; #INTERNAL_USE_ONLY#============================================================= ;__Config_CreateKeyRecursive ;__Config_KeyExists ;__Config_SetFileToHandle ;__Config_GetFileFromHandle ;__Config_RemoveFileHandle ;__Config_COMErr ;__Config_InitCOMErr ; ================================================================================ ; #FUNCTION# ===================================================================== ; Name...........: _Config_Create ; Description ...: Creates a configuration file ; Syntax.........: _Config_Create($szFileName, $iOverwrite = 0, $szRoot = "",$iEncoding = 0) ; Parameters ....: $szFileName - The filename for the configuration file ; : $iOverwrite - Overwrite exisiting file ; |0 - Don't overwrite, and return error ; |1 - Overwrite the file. ; |2 - Prompt to overwrite. ; $szRoot - The value for the root node ; $iEncoding - The encoding to use ; |0 - Default (UTF-16) ; |1 - iso-8859-1 ; |2 - UTF-8 ; |3 - UTF-16 ; Return values .: Success - An XML object handle ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: Creates the configuration file using the default encoding and root name. After creation, ; _Config_Open is called and the handle returned. This file handle and the filename are cached ; and later used by _Config_Close and _Config_Save ; Related .......: _Config_Open, _Config_Close, _Config_Save, _Config_SaveAs ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Create($szFileName, $iOverwrite = 0, $szRoot = "", $iEncoding = 0) If $szRoot = "" Then $szRoot = "CONFIG" If FileExists($szFileName) Then If $iOverwrite = 0 Then Return SetError(1, 0, 0) If $iOverwrite = 2 Then If MsgBox(266292, @ScriptName, "The file: " & $szFileName & " , already exists. Do you wish to overwrite the file?") <> 6 Then Return SetError(1, 0, 0) EndIf EndIf Local $hConfig, $objPI, $objRoot $hConfig = ObjCreate("MSXML2.DOMDocument") If $iEncoding <= 0 Or $iEncoding > UBound($XML_ENCODING) Then $iEncoding = $XML_ENCODING[0] $objPI = $hConfig.createProcessingInstruction("xml", StringFormat('version="1.0" encoding="%s"', $XML_ENCODING[$iEncoding])) $hConfig.appendChild($objPI) $objRoot = $hConfig.createElement($szRoot) $hConfig.documentElement = $objRoot $hConfig.save($szFileName) If $hConfig.parseError.errorCode <> 0 Then ConsoleWriteError("Error Creating specified file: " & $szFileName) SetError($hConfig.parseError.errorCode, 0, 0) Return 0 EndIf $objPI = 0 $objRoot = 0 $hConfig = 0 Return _Config_Open($szFileName) EndFunc ;==>_Config_Create ; #FUNCTION# =================================================================== ; Name...........: _Config_Open ; Description ...: Opens a configuration file ; Syntax.........: _Config_Open($szFileName) ; Parameters ....: $szFileName - The configuration file to open ; Return values .: Success - An XML object handle. ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: Opens an XML configuration file and if succesful returns the object handle to the file. ; Related .......: _Config_Create, _Config_Close, _Config_Save, _Config_SaveAs ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Open($szFileName) Local $hConfig $hConfig = ObjCreate("Msxml2.DOMDocument") If @error Then Return SetError(1, 0, 0) If IsObj($hConfig) Then __Config_InitCOMErr() $hConfig.async = False $hConfig.preserveWhiteSpace = True $hConfig.Load($szFileName) $hConfig.setProperty("SelectionLanguage", "XPath") If $hConfig.parseError.errorCode <> 0 Then ;ConsoleWriteError("Error opening specified file: " & $szFileName & @CRLF & $hConfig.parseError.reason) SetError($hConfig.parseError.errorCode, 0, 0) Return 0 EndIf __Config_SetFileToHandle($hConfig, $szFileName) Return $hConfig EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_Open ; #FUNCTION# =================================================================== ; Name...........: _Config_Read ; Description ...: Read a value from the configuration file. ; Syntax.........: _Config_Read($hConfig, $szParam, $szValue) ; Parameters ....: $hConfig - The object handle returned by _Config_Open or _Config_Create. ; $szParam - The name of the parameter to Read the value of. ; $szValue - The value name to read. ; Return values .: Success - The value. ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: ; Related .......: _Config_Write, _Config_Delete ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Read(ByRef $hConfig, $szParam, $szValue) If Not IsObj($hConfig) Then Return SetError(1, 0, 0) If $szParam = "" Then Return SetError(1, 0, 0) If $szValue Then $szParam &= "/" & $szValue Local $objKey, $szRet $szParam = StringReplace($szParam, "\", "/") $objKey = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()") If IsObj($objKey) Then $szRet = $objKey.nodeValue $objKey = 0 Return $szRet EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_Read ; #FUNCTION# =================================================================== ; Name...........: _Config_Write ; Description ...: Write a value in the configuration file. ; Syntax.........: _Config_Set($hConfig, $szParam, $vValue) ; Parameters ....: $hConfig - The object handle returned by _Config_Open or _Config_Create. ; $szParam - The name of the parameter to write to ; $szValue - The value name to write to ; $vValue - The value to write. ; Return values .: Success - 1 ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: Call _Config_Save or _Config_SaveAs to save any changes made. ; Related .......: _Config_Read, _Config_Delete ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Write(ByRef $hConfig, $szParam, $szValue, $vValue) Local $err If Not IsObj($hConfig) Then Return SetError(1, 0, 0) If $szParam = "" Then Return SetError(1, 0, 0) If $szValue Then $szParam &= "/" & $szValue $szParam = StringReplace($szParam, "\", "/") If __Config_KeyExists($hConfig, $szParam) Then Local $objKey = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()") If IsObj($objKey) Then $objKey.text = $vValue Else Local $objChild = $hConfig.createTextNode($vValue) $objKey = $hConfig.documentElement.selectSingleNode($szParam) $objKey.appendChild($objChild) $err = @error $objChild = 0 $objKey = 0 If $err Then Return SetError(1, 0, 0) EndIf $objKey = 0 Else __Config_CreateKeyRecursive($hConfig, $szParam, $vValue) If @error Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==>_Config_Write ; #FUNCTION# =================================================================== ; Name ..........: _Config_Delete ; Description ...: Delete a param from the config file. ; Syntax ........: _Config_Delete($hConfig, $szParam ,$szValue = "") ; Parameters ....: $hConfig - The config file handle ; $szParam - The name of the parameter to delete ; $szValue - The name of the value to delete ; Return values .: Success - 1 ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: Call _Config_Save or _Config_SaveAs to save any changes made. ; If $szValue is skipped then the parameter and sub-parameters are deleted. ; Related .......: _Config_Read, _Config_Write ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Delete(ByRef $hConfig, $szParam, $szValue = "") If Not IsObj($hConfig) Then Return SetError(1, 0, 0) If $szParam = "" Then Return SetError(1, 0, 0) If $szValue Then $szParam &= "/" & $szValue $szParam = StringReplace($szParam, "\", "/") Local $objKey, $objChild $objKey = $hConfig.documentElement.selectSingleNode($szParam) If IsObj($objKey) Then ;only remove param if no sub-params like regedit If $objKey.hasChildNodes Then $objChild = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()") If IsObj($objChild) Then $objChild.parentNode.removeChild($objChild) EndIf $objKey = $hConfig.documentElement.selectSingleNode($szParam) If Not $objKey.hasChildNodes Then $objKey.parentNode.removeChild($objKey) EndIf $objChild = 0 $objKey = 0 Return 1 EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_Delete ; #FUNCTION# =================================================================== ; Name ..........: _Config_EnumParam ; Description ...: Reads the name of a parameter according to it's index. ; Syntax ........: _Config_EnumParam($hConfig,$szParam,$iIndex = 1) ; Parameters ....: $hConfig - The config file handle ; $szParam - The name of the parameter to enumerate ; $iIndex - The 1-based index to retrieve ; Return values .: Success - The param ; Failure - 0 or empty String ("") and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: An empty string can be used for $szParam to enumerate the parameters under the root node. ; Related .......: _Config_EnumVal ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_EnumParam($hConfig, $szParam, $iIndex = 1) If $iIndex < 1 Or Not IsObj($hConfig) Then Return SetError(1, 0, 0) $szParam = StringReplace($szParam, "\", "/") Local $objKey, $vRet If $szParam = "" Then $szParam = "*[" & $iIndex & "]" Else $szParam &= "/*[" & $iIndex & "]" EndIf $objKey = $hConfig.documentElement.selectSingleNode($szParam) If IsObj($objKey) Then $vRet = $objKey.nodeName $objKey = 0 Return SetError(($vRet = ""), 0, $vRet) EndFunc ;==>_Config_EnumParam ; #FUNCTION# =================================================================== ; Name ..........: _Config_EnumVal ; Description ...: Reads the value to a parameter according to it's index. ; Syntax ........: _Config_EnumVal($hConfig,$szParam,$iIndex) ; Parameters ....: $hConfig - The config file handle ; $szParam - The name of the parameter to enumerate ; $iIndex - The 1-based index to retrieve ; Return values .: Success - The value of the parameter ; Failure - 0 or empty string ("") and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: An empty string can be used for $szParam to enumerate the parameters under the root node. ; Related .......: ; Link ..........: _Config_EnumParam ; Example .......: Yes ; ================================================================================ Func _Config_EnumVal($hConfig, $szParam, $iIndex) If $iIndex < 1 Or Not IsObj($hConfig) Then Return SetError(1, 0, 0) $szParam = StringReplace($szParam, "\", "/") Local $objKey, $objChild, $vRet If $szParam = "" Then $szParam = "*[" & $iIndex & "]" Else $szParam &= "/*[" & $iIndex & "]" EndIf $objKey = $hConfig.documentElement.selectSingleNode($szParam) If IsObj($objKey) Then If $objKey.hasChildNodes Then $objChild = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()") If IsObj($objChild) Then $vRet = $objChild.nodeValue EndIf EndIf $objChild = 0 $objKey = 0 Return SetError(($vRet = ""), 0, $vRet) EndFunc ;==>_Config_EnumVal ; #FUNCTION# =================================================================== ; Name...........: _Config_Save ; Description ...: Save the config file ; Syntax.........: _Config_Save($hConfig) ; Parameters ....: $hConfig - The config file handle ; Return values .: Success - 1 ; Failure - 0 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: This function explicitly saves the configuration file. The filename is ; retrieved from the handle cache. Use _Config_SaveAs the specify a filename. ; Related .......: _Config_SaveAs ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Save(ByRef $hConfig) If IsObj($hConfig) Then Local $szFileName = __Config_GetFileFromHandle($hConfig) If $szFileName <> "" Then $hConfig.save($szFileName) If @error = 0 Then Return 1 EndIf EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_Save ; #FUNCTION# =================================================================== ; Name...........: _Config_SaveAs ; Description ...: Save the config file as another filename ; Syntax.........: _Config_SaveAs($hConfig, $szFileName, $iOverwrite = 0) ; Parameters ....: $hConfig - The config file handle ; $szFileName - The file name to save as. ; $iOverwrite - The overwrite flag. ; |0 - Don't overwrite, and return error ; |1 - Overwrite the file. ; |2 - Prompt to overwrite. ; Return values .: Success - 1 ; Failure - 0 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: This function will save the configuration using the supplied file name. The new file name will ; now be associated with the file handle. ; Related .......: _Config_Save ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_SaveAs(ByRef $hConfig, $szFileName, $iOverwrite = 0) If IsObj($hConfig) And $szFileName <> "" Then If FileExists($szFileName) Then If $iOverwrite = 0 Then Return SetError(1, 0, 0) If $iOverwrite = 2 Then If MsgBox(266292, @ScriptName, "The file: " & $szFileName & " , already exists. Do you wish to overwrite the file?") <> 6 Then Return SetError(1, 0, 0) EndIf EndIf $hConfig.save($szFileName) If @error = 0 Then __Config_SetFileToHandle($hConfig, $szFileName) Return 1 EndIf EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_SaveAs ; #FUNCTION# =================================================================== ; Name...........: _Config_Close ; Description ...: Close the config file ; Syntax.........: _Config_Close($hConfig,$iSaveOnClose = 1) ; Parameters ....: $hConfig - The config file handle ; $iSaveOnClose - Save when closing the file. Defaults to 1 (yes) ; Return values .: Success - 1 ; Failure - 0 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: If $iSaveOnClose = 1 then the an attempt to save the config file will be made. ; Related .......: _Config_Create, _Config_Open, _Config_Save ; Link ..........: ; Example .......: Yes ; ================================================================================ Func _Config_Close(ByRef $hConfig, $iSaveOnClose = 1) Local $vRet If IsObj($hConfig) Then If $iSaveOnClose Then _Config_Save($hConfig) $vRet = @error EndIf EndIf __Config_RemoveFileHandle($hConfig) $hConfig = 0 Return SetError($vRet, 0, ($vRet = 0)) EndFunc ;==>_Config_Close ; #FUNCTION# =================================================================== ; Name ..........: _Config_Indent ; Description ...: Indents an XML file ; Syntax ........: _Config_Indent($szFileName, $iEncoding = 0) ; Parameters ....: $szFileName - The file to indent ; $iEncoding - The encoding to use ; |0 - Default (UTF-16) ; |1 - iso-8859-1 ; |2 - UTF-8 ; |3 - UTF-16 ; Return values .: None ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: Uses msxml SAX methods to indent an xml file. It is NOT PERFECT. HTML-Tidy does a much better job. ; Requires MSXML4.0 or greater. ; Related .......: ; Link ..........: http://tidy.sourceforge.net ; Example .......: Yes ; ================================================================================ Func _Config_Indent($szFileName, $iEncoding = 0) Local $oOutput = ObjCreate("MSXML2.DOMDocument.4.0") Local $oReader = ObjCreate("MSXML2.SAXXMLReader.4.0") Local $oWriter = ObjCreate("MSXML2.MXXMLWriter.4.0") If @error Then $oWriter = ObjCreate("MSXML2.MXXMLWriter.6.0") If @error Then Return SetError(1, 0, 0) EndIf If $iEncoding <= 0 Or $iEncoding > UBound($XML_ENCODING) Then $iEncoding = $XML_ENCODING[0] $oWriter.indent = True $oWriter.byteOrderMark = True $oWriter.encoding = $XML_ENCODING[$iEncoding] $oWriter.omitXMLDeclaration = False $oWriter.standalone = True $oReader.contentHandler = $oWriter $oReader.parseURL($szFileName) $oOutput.loadXML($oWriter.output) $oOutput.save($szFileName) $oReader = 0 $oWriter = 0 $oOutput = 0 EndFunc ;==>_Config_Indent ; #FUNCTION# =================================================================== ; Name ..........: _Config_Base64_Encode ; Description ...: Encodes the data input to base64. ; Syntax ........: _Config_Base64_Encode($vData) ; Parameters ....: $vData - The base64 string to Encode ; Return values .: Success - The encoded base64 string. ; Failure -0 or empty string ("") and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: This fails to produce desired results unless using AutoIt ver 3.3.0.0 ; or greater as byte array support for COM was not included previously. ; Related .......: ; Link ..........: ; Example .......: yes ; ================================================================================ Func _Config_Base64_Encode($vData) Local $err, $oXML If StringLeft(@AutoItVersion, 3) = "3.3" Then $oXML = ObjCreate("MSXML2.DOMDocument") $oXML.loadXML("<root/>") $oXML.documentElement.dataType = "bin.base64" If IsString($vData) Then $vData = StringToBinary($vData) $oXML.documentElement.NodeTypedValue = $vData Local $vRet = $oXML.documentElement.Text $err = @error $oXML = 0 Return SetError(($err <> 0 Or $vRet = ""), $err, $vRet) EndIf Return SetError(1, 0, 0) EndFunc ;==>_Config_Base64_Encode ; #FUNCTION# =================================================================== ; Name ..........: _Config_Base64_Decode ; Description ...: Decodes a Base64 string to binary. ; Syntax ........: _Config_Base64_Decode($vData, $iFlag = 0) ; Parameters ....: $vData - The base64 string to decode ; $iFlag - Set return type 0 = binary, anything else = text(String). ; Return values .: Success - The decoded base64 string in binary or text. ; Failure - @error set to 1. Return value may contain an error message. ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: This fails to produce desired results unless using AutoIt ver 3.3.0.0 ; or greater as byte array support for COM was not included previously. ; Related .......: ; Link ..........: ; Example .......: yes ; ================================================================================ Func _Config_Base64_Decode($vData, $iFlag = 0) Local $oXML, $vRet, $err = 0 If StringLeft(@AutoItVersion, 3) = "3.3" Then $oXML = ObjCreate("MSXML2.DOMDocument") $oXML.loadXML("<root/>") $oXML.documentElement.dataType = "bin.base64" $oXML.documentElement.text = $vData $vRet = $oXML.documentElement.NodeTypedValue $err = @error $oXML = 0 If $iFlag Then Return SetError(($err <> 0), $err, BinaryToString($vRet)) Return SetError(($err <> 0), $err, $vRet) EndIf Return SetError(1, 0, "") EndFunc ;==>_Config_Base64_Decode ; #INTERNAL_USE_ONLY# ============================================================ ; Name ..........: __Config_CreateKeyRecursive ; Description ...: Recursive method to create parameter key. ; Syntax ........: __Config_CreateKeyRecursive(ByRef $hConfig, $szParam, $vValue) ; Parameters ....: $hConfig - The config file handle ; $szParam - The name of the parameter to create. ; $vValue - The value of the parameter. ; Return values .: Succes - 1 ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki {gehossafats at netmdc. com} ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; No ; ================================================================================ Func __Config_CreateKeyRecursive(ByRef $hConfig, $szParam, $vValue) If Not IsObj($hConfig) Then Return SetError(1, 0, 0) Local $aTemp = StringSplit($szParam, "\/") Local $objKey Local $sPath = "/" & $hConfig.documentElement.NodeName For $x = 1 To $aTemp[0] If Not __Config_KeyExists($hConfig, $sPath & "/" & $aTemp[$x]) Then Local $objChild = $hConfig.createNode($NODE_XML_ELEMENT, $aTemp[$x], "") If $x = $aTemp[0] Then $objChild.text = $vValue If $x = 1 Then $hConfig.documentElement.appendChild($objChild) Else $objKey = $hConfig.selectSingleNode($sPath) $objKey.appendChild($objChild) EndIf EndIf $sPath &= "/" & $aTemp[$x] Next Local $szFileName = __Config_GetFileFromHandle($hConfig) If $szFileName <> "" Then $hConfig.save($szFileName) EndIf Return 1 EndFunc ;==>__Config_CreateKeyRecursive ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_KeyExists ; Description ...: Check if a node name exists ; Syntax ........: __Config_KeyExists(ByRef $hConfig, $szParam) ; Parameters ....: $hConfig - The config file handle ; $szParam - The name of the parameter to check for. ; Return values .: Success - 1 ; Failure - 0 ; Author ........: Stephen Podhajecki {gehossafats at netmdc. com} ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; no ; ================================================================================ Func __Config_KeyExists(ByRef $hConfig, $szParam) If StringStripWS($szParam, 3) = "" Then Return SetError(1, 0, "") If Not IsObj($hConfig) Then Return SetError(1, 0, 0) Local $node = $hConfig.documentelement.selectSingleNode($szParam) If IsObj($node) Then $node = 1 Else $node = 0 EndIf Return $node EndFunc ;==>__Config_KeyExists ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_GetFileFromHandle ; Description ...: ; Syntax ........: __Config_GetFileFromHandle(ByRef $hConfig) ; Parameters ....: $hConfig - The config file handle ; Return values .: Success - The filename and @extended contains the index in the cache ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: no ; ================================================================================ Func __Config_GetFileFromHandle(ByRef $hConfig) For $x = 1 To $aCONFIG_FHDS[0][0] If $hConfig = $aCONFIG_FHDS[$x][0] Then Return SetError(0, $x, $aCONFIG_FHDS[$x][1]) Next Return SetError(1, 0, 0) EndFunc ;==>__Config_GetFileFromHandle ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_SetFileToHandle ; Description ...: Add or changes the file handle to filename association in the handle cache. ; Syntax ........: __Config_SetFileToHandle(ByRef $hConfig , $szFileName) ; Parameters ....: $hConfig - The config file handle ; $szFileName - The filename to associate with the handle ; Return values .: Success - 1 ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: no ; ================================================================================ Func __Config_SetFileToHandle(ByRef $hConfig, $szFileName) If IsObj($hConfig) And $szFileName <> "" Then If __Config_GetFileFromHandle($hConfig) <> "" Then $aCONFIG_FHDS[@extended][1] = $szFileName Else $aCONFIG_FHDS[0][0] += 1 ReDim $aCONFIG_FHDS[$aCONFIG_FHDS[0][0] + 1][2] $aCONFIG_FHDS[$aCONFIG_FHDS[0][0]][0] = $hConfig $aCONFIG_FHDS[$aCONFIG_FHDS[0][0]][1] = $szFileName EndIf Return 1 EndIf Return SetError(1, 0, 0) EndFunc ;==>__Config_SetFileToHandle ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_RemoveFileHandle ; Description ...: Removes a file handle and it's associated filename from the cache. ; Syntax ........: __Config_RemoveFileHandle(ByRef $hConfig) ; Parameters ....: $hConfig - The config file handle ; Return values .: Success - The index of the removed item ; Failure - 0 and @error set to 1 ; Author ........: Stephen Podhajecki (eltorro) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: no ; ================================================================================ Func __Config_RemoveFileHandle(ByRef $hConfig) For $x = 1 To $aCONFIG_FHDS[0][0] If $hConfig = $aCONFIG_FHDS[$x][0] Then For $y = $x To $aCONFIG_FHDS[0][0] - 1 $aCONFIG_FHDS[$y][0] = $aCONFIG_FHDS[$y + 1][0] $aCONFIG_FHDS[$y][1] = $aCONFIG_FHDS[$y + 1][1] Next $aCONFIG_FHDS[0][0] -= 1 ReDim $aCONFIG_FHDS[$aCONFIG_FHDS[0][0] + 1][2] Return $x EndIf Next Return SetError(1, 0, 0) EndFunc ;==>__Config_RemoveFileHandle ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_COMErr ; Description ...: Sven com error handler ; Syntax ........: __Config_COMErr() ; Parameters ....: None. ; Return values .: @Error set to 1 and @Extended set to the COM error number. ; Author ........: ; Modified.......: ; Remarks .......: Default error handler. ; Related .......: __Config_InitCOMErr ; Link ..........: ; Example .......: no ; ================================================================================ Func __Config_COMErr() Local $HexNumber = Hex($__COM_ERR.number, 8) If @error Then Return SetError(1, 0, 0) Local $msg = "COM Error with DOM!" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $__COM_ERR.description & @CRLF & _ "err.windescription:" & @TAB & $__COM_ERR.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $__COM_ERR.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $__COM_ERR.scriptline & @CRLF & _ "err.source is: " & @TAB & $__COM_ERR.source & @CRLF & _ "err.helpfile is: " & @TAB & $__COM_ERR.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $__COM_ERR.helpcontext ;MsgBox(0, @AutoItExe, $msg) SetError(1, $__COM_ERR.number, $msg) EndFunc ;==>__Config_COMErr ; #INTERNAL_USE_ONLY#============================================================= ; Name ..........: __Config_InitCOMErr ; Description ...: Initialize the COM error event handler. ; Syntax ........: __Config_InitCOMErr([$sFunction]) ; Parameters ....: $sFunction - Function for COM error handler ; Return values .: None. ; Author ........: ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: [yes/no] ; ================================================================================ Func __Config_InitCOMErr($sFunction = "__Config_COMErr") If $__COM_ERR <> "" Then $__COM_ERR = "" $__COM_ERR = ObjEvent("AutoIt.Error", $sFunction) ; ; Initialize SvenP 's error handler EndFunc ;==>__Config_InitCOMErr1 point -
Two words from a list, all combos.
sdfaheemuddin reacted to SadBunny for a topic
No, you do not sound dumb, you sound inexperienced. Dumb is when you fail to formulate your question carefully and still expect a useful answer. Practice. Lots of practice. It's all a puzzle where you have a large degree of freedom in the workings of the pieces.1 point