Leaderboard
Popular Content
Showing content with the highest reputation on 05/28/2020 in all areas
-
ObjEvent - Bytescout.PDFExtractor.dll + ProgressEventHandler
argumentum and one other reacted to mLipok for a topic
Do you live in the same City as @Danyfirex2 points -
FuncName Ooh @mLipok beat me to it. 😁2 points
-
Function Variables
seadoggie01 and one other reacted to mLipok for a topic
In my UDF sets, I just check where IsFunc($variable) is used..... ADO.au3 Func __ADO_EVENT__FetchProgress($iProgress, $iMaxProgress, $i_adStatus, ByRef $oRecordset) If Not _ADO_EVENTS_SetUp() Then Return __ADO_ConsoleWrite_Blue(" ADO EVENT fired function: __ADO_EVENT__FetchProgress:") __ADO_ConsoleWrite_Blue(" $iProgress=" & $iProgress) __ADO_ConsoleWrite_Blue(" $iMaxProgress=" & $iMaxProgress) __ADO_ConsoleWrite_Blue(" $i_adStatus=" & $i_adStatus) If IsFunc($__g_fnFetchProgress) Then $__g_fnFetchProgress($iProgress, $iMaxProgress, $i_adStatus, $oRecordset) EndIf #forceref $oRecordset EndFunc ;==>__ADO_EVENT__FetchProgress ... Func _ADO_COMErrorHandler_UserFunction($fnUserFunction = Default) ; in case when user do not set his own function UDF must use internal function to avoid AutoItError Local Static $fnUserFunction_Static = '' If $fnUserFunction = Default Then If Not IsFunc($fnUserFunction) Then Return SetExtended(1, $fnUserFunction_Static) ; just return stored static variable Return $fnUserFunction_Static ElseIf IsFunc($fnUserFunction) Then ; set and return static variable $fnUserFunction_Static = $fnUserFunction Return $fnUserFunction_Static Else ; reset static variable $fnUserFunction_Static = '' Return SetError($ADO_ERR_INVALIDPARAMETERTYPE, $ADO_EXT_DEFAULT, $fnUserFunction_Static) EndIf EndFunc ;==>_ADO_COMErrorHandler_UserFunction ... Func __ADO_ComErrorHandler_InternalFunction(ByRef $oCOMError) ; Do nothing special, just check @error after suspect functions. #forceref $oCOMError Local $sUserFunction = _ADO_COMErrorHandler_UserFunction() If IsFunc($sUserFunction) Then $sUserFunction($oCOMError) EndFunc ;==>__ADO_ComErrorHandler_InternalFunction _GUIRegisterMsgEx.au3 If (@error = $GUIREGISTERMSGEX_CALL_ERROR And @extended = $GUIREGISTERMSGEX_CALL_PARAMS) Then If IsFunc($g__fnGUIREGISTERMSGEX_CALLBACK_WRONG_PARAM_ALERT) Then $g__fnGUIREGISTERMSGEX_CALLBACK_WRONG_PARAM_ALERT() EndIf ErrorLog.au3 Func _Log_SetOutputFunction($fnFunction = Default) Local Static $fnFunction_static = Null If $fnFunction = Default And IsFunc($fnFunction_static) Then Return $fnFunction_static If Not IsFunc($fnFunction) Then Return SetError(1) $fnFunction_static = $fnFunction Return $fnFunction_static EndFunc ;==>_Log_SetOutputFunction XML.au3 Func _XML_ComErrorHandler_UserFunction($fnUserFunction = Default) ; in case when user do not set his own function UDF must use internal function to avoid AutoItError Local Static $fnUserFunction_Static = '' If $fnUserFunction = Default Then Return $fnUserFunction_Static ; just return stored static variable ElseIf IsFunc($fnUserFunction) Then $fnUserFunction_Static = $fnUserFunction ; set and return static variable Return $fnUserFunction_Static EndIf $fnUserFunction_Static = '' ; reset static variable ; return error as incorrect parameter was passed to this function Return SetError($XML_ERR_PARAMETER, $XML_EXT_PARAM1, $fnUserFunction_Static) EndFunc ;==>_XML_ComErrorHandler_UserFunction .... Func __XML_ComErrorHandler_InternalFunction($oCOMError) ; If not defined ComErrorHandler_UserFunction then this function do nothing special ; In that case you only can check @error / @extended after suspect functions Local $sUserFunction = _XML_ComErrorHandler_UserFunction() If IsFunc($sUserFunction) Then $sUserFunction($oCOMError) EndFunc ;==>__XML_ComErrorHandler_InternalFunction2 points -
Function Variables
seadoggie01 and one other reacted to therks for a topic
I've used it to swap which function is used in specific situations. For example this bit of code: Local $fClientPrompt = _ClientPromptWindow If IniRead($CONFIG_FILE, 'CLIENT', 'PROMPT', 'Buttons') = 'Menu' Then $fClientPrompt = _ClientPromptMenu EndIf $iChoice = $fClientPrompt($DEFAULT_ITEM, $APP_PATH)2 points -
Function Variables
seadoggie01 and one other reacted to jchd for a topic
It promotes functions to first-class citizenship. Pretty handy in my view: Global $AD = (@AutoItVersion = "3.3.14.5" ? _DebugArrayDisplay : _ArrayDisplay) Global $CW = @Compiled ? __ConsoleWrite : _ConsoleWrite ; if compiled, create a console Func __ConsoleWrite(ByRef $s) Local Static $hCon = __ConsoleInit() DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $hCon, "wstr", $s & @LF, "dword", StringLen($s) + 1, "dword*", 0, "ptr", 0) Return EndFunc ;==>__ConsoleWrite Func __ConsoleInit() DllCall("kernel32.dll", "bool", "AllocConsole") Return DllCall("kernel32.dll", "handle", "GetStdHandle", "int", -11)[0] EndFunc ;==>__ConsoleInit ; if simply run, use Scite's Unicode-aware ConsoleWrite Func _ConsoleWrite($s) ConsoleWrite(BinaryToString(StringToBinary($s & @LF, 4), 1)) EndFunc ;==>_ConsoleWrite2 points -
Introduction JSON (Javascript Object Notation) is a popular data-interchange format and supported by a lot of script languages. On AutoIt, there is already a >JSON UDF written by Gabriel Boehme. It is good but too slow, and not supports unicode and control characters very well. So I write a new one (and of course, fast one as usual). I use a machine code version of JSON parser called "jsmn". jsmn not only supports standard JSON, but also accepts some non-strict JSON string. See below for example. Important Update!! I rename the library from jsmn.au3 to json.au3. All function names are changed, too. Decoding Function Json_Decode($Json) $Json can be a standard or non-standard JSON string. For example, it accepts: { server: example.com port: 80 message: "this looks like a config file" } The most JSON data type will be decoded into corresponding AutoIt variable, including 1D array, string, number, true, false, and null. JSON object will be decoded into "Windows Scripting Dictionary Object" retuned from ObjCreate("Scripting.Dictionary"). AutoIt build-in functions like IsArray, IsBool, etc. can be used to check the returned data type. But for Object and Null, Json_IsObject() and Json_IsNull() should be used. If the input JSON string is invalid, @Error will be set to $JSMN_ERROR_INVAL. And if the input JSON string is not finish (maybe read from stream?), @Error will be set to $JSMN_ERROR_PART. Encoding Function Json_Encode($Data, $Option = 0, $Indent = "\t", $ArraySep = ",\r\n", $ObjectSep = ",\r\n", $ColonSep = ": ") $Data can be a string, number, bool, keyword(default or null), 1D arrry, or "Scripting.Dictionary" COM object. Ptr will be converted to number, Binary will be converted to string in UTF8 encoding. Other unsupported types like 2D array, dllstruct or object will be encoded into null. $Option is bitmask consisting following constant: $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) $JSON_UNESCAPED_UNICODE ; Encode multibyte Unicode characters literally $JSON_UNESCAPED_SLASHES ; Don't escape / $JSON_HEX_TAG ; All < and > are converted to \u003C and \u003E $JSON_HEX_AMP ; All &amp;amp;amp;s are converted to \u0026 $JSON_HEX_APOS ; All ' are converted to \u0027 $JSON_HEX_QUOT ; All " are converted to \u0022 $JSON_PRETTY_PRINT ; Use whitespace in returned data to format it $JSON_STRICT_PRINT ; Make sure returned JSON string is RFC4627 compliant $JSON_UNQUOTED_STRING ; Output unquoted string if possible (conflicting with $JSMN_STRICT_PRINT) Most encoding option have the same means like PHP's json_enocde() function. When $JSON_PRETTY_PRINT is set, output format can be change by other 4 parameters ($Indent, $ArraySep, $ObjectSep, and $ColonSep). Because these 4 output format parameters will be checked inside Jsmn_Encode() function, returned string will be always accepted by Jsmn_Decode(). $JSON_UNQUOTED_STRING can be used to output unquoted string that also accetped by Jsmn_Decode(). $JSON_STRICT_PRINT is used to check output format setting and avoid non-standard JSON output. So this option is conflicting with $JSON_UNQUOTED_STRING. Get and Put Functions Json_Put(ByRef $Var, $Notation, $Data, $CheckExists = False) Json_Get(ByRef $Var, $Notation) These functions helps user to access object or array more easily. Both dot notation and square bracket notation can be supported. Json_Put() by default will create non-exists objects and arrays. For example: Local $Obj Json_Put($Obj, ".foo", "foo") Json_Put($Obj, ".bar[0]", "bar") Json_Put($Obj, ".test[1].foo.bar[2].foo.bar", "Test") Local $Test = Json_Get($Obj, '["test"][1]["foo"]["bar"][2]["foo"]["bar"]') ; "Test" Object Help Functions Json_ObjCreate() Json_ObjPut(ByRef $Object, $Key, $Value) Json_ObjGet(ByRef $Object, $Key) Json_ObjDelete(ByRef $Object, $Key) Json_ObjExists(ByRef $Object, $Key) Json_ObjGetCount(ByRef $Object) Json_ObjGetKeys(ByRef $Object) Json_ObjClear(ByRef $Object) These functions are just warps of "Scripting.Dictionary" COM object. You can use these functions if you are not already familiar with it. == Update 2013/05/19 == * Add Jsmn_Encode() option "$JSMN_UNESCAPED_ASCII". Now the default output of Json_Encode() is exactly the same as PHP's json_encode() function (for example, chr(1) will be encoded into u0001). $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) == Update 2015/01/08 == * Rename the library from jsmn.au3 to json.au3. All function names are changed, too. * Add Json_Put() and Json_Get() * Add Null support * Using BinaryCall.au3 to loading the machine code. == Update 2018/01/13== (Jos) * Add JsonDump() to list all Json Keys and their values to easily figure out what they are. == Update 2018/10/01== (Jos) * Fixed JsonDump() some fields and values were not showing as discussed here - tnx @TheXman . == Update 2018/10/01b== (Jos) * Added Json_ObjGetItems, Tidied source and fixed au3check warnings - tnx @TheXman . == Update 2018/10/28== (Jos) * Added declaration for $value to avoid au3check warning - tnx @DerPensionist == Update 2018/12/16== (Jos) * Added another declaration for $value to avoid au3check warning and updated the version at the top - tnx @maniootek == Update 2018/12/29== (Jos) * Changed Json_ObjGet() and Json_ObjExists() to allow for multilevel object in string. == Update 2019/01/17== (Jos) * Added support for DOT notation in JSON functions. == Update 2019/07/15== (Jos) * Added support for reading keys with a dot inside when using a dot as separator (updated) == Update 2021/11/18== (TheXman) * Update details in below post: == Update 2021/11/20== (TheXman) * Minor RegEx update, no change to the functionality or result._Json(2021.11.20).zip1 point
-
I will let @Musashi solve his "issue". But here an example of what I proposed earlier : #include <Timers.au3> #include <Constants.au3> Global Const $DELAY = 25000 HotKeySet("{ESC}", _Exit) While True If _Timer_GetIdleTime() > $DELAY Then MouseClick($MOUSE_CLICK_LEFT) ShellExecute('Notepad.exe') EndIf Sleep (100) WEnd Func _Exit() Exit EndFunc1 point
-
Looks good to me : #include <Array.au3> #include <WinAPIFiles.au3> #include <WinAPIMem.au3> #include <WinAPIConv.au3> #include <WinAPIHObj.au3> Local $kernel32 = DllOpen('kernel32.dll') Local $USN_JOURNAL_DATA = 'UINT64 UsnJournalID;INT64 FirstUsn;INT64 NextUsn;INT64 LowestValidUsn;INT64 MaxUsn;UINT64 MaximumSize;' & _ 'UINT64 AllocationDelta; WORD MinSupportedMajorVersion;WORD MaxSupportedMajorVersion' ;step 01. Determine whether the drive disk is in NTFS format Local $aRet = _WinAPI_GetVolumeInformation('E:\') If UBound($aRet) < 4 Then Exit MsgBox($MB_SYSTEMMODAL, "", "Error on drive e:") If $aRet[4] <> 'NTFS' Then Exit MsgBox ($MB_SYSTEMMODAL,"",'This drive is not in NTFS format') ;step 02. Get driver handle Local $hVol = _WinAPI_CreateFile("\\.\E:", $OPEN_EXISTING, 7, 7) If $hVol = 0 Then Exit MsgBox ($MB_SYSTEMMODAL,"",'Failed to get driver handle') ;step 03. Initialize USN Journal file Local $cujd = DllStructCreate('UINT64 MaximumSize;UINT64 AllocationDelta;') $cujd.MaximumSize = 0 ; $cujd.AllocationDelta = 0 ; $aRet = _WinAPI_DeviceIoControl($hVol, $FSCTL_CREATE_USN_JOURNAL, DllStructGetPtr($cujd), DllStructGetSize($cujd)) If Not $aRet Then Exit MsgBox ($MB_SYSTEMMODAL,"",'Errer to initialize USN Journal file') ;step 04. Get basic information of USN Journal Local $UsnInfo = DllStructCreate($USN_JOURNAL_DATA) $aRet = _WinAPI_DeviceIoControl($hVol, $FSCTL_QUERY_USN_JOURNAL, Null, 0, DllStructGetPtr($UsnInfo), DllStructGetSize($UsnInfo)) If Not $aRet Then Exit MsgBox ($MB_SYSTEMMODAL,"",StringFormat("Failed to get basic information of USN Journal —— status:%x error:%d\n", $aRet, _WinAPI_GetLastError())) ConsoleWrite("Number of bytes returned = " & @extended & @CRLF) ConsoleWrite(StringFormat("UsnJournalID: %11x\n", $UsnInfo.UsnJournalID)) ConsoleWrite(StringFormat("lowUsn: %11x\n", $UsnInfo.FirstUsn)) ConsoleWrite(StringFormat("highUsn: %11x\n", $UsnInfo.NextUsn)) ;step 05. Enumerate all records in USN Journal file Local $MFT_ENUM_DATA = DllStructCreate('UINT64 StartFileReferenceNumber; UINT64 LowUsn; UINT64 HighUsn') $MFT_ENUM_DATA.StartFileReferenceNumber = 0 $MFT_ENUM_DATA.LowUsn = 0 $MFT_ENUM_DATA.HighUsn = $UsnInfo.NextUsn Local $buffer = DllStructCreate('byte[4096]') Local $USN = DllStructCreate('UINT64 ptr', DllStructGetPtr($buffer)) Local $iLength, $iPos, $tPUSN_RECORD, $sFileName, $iCount = 0 While _WinAPI_DeviceIoControl($hVol, $FSCTL_ENUM_USN_DATA, $MFT_ENUM_DATA, DllStructGetSize($MFT_ENUM_DATA), $buffer, DllStructGetSize($buffer)) $iLength = @extended $iCount += 1 ConsoleWrite("Length / Count = " & $iLength & "/" & $iCount & @CRLF) $iPos = DllStructGetSize($USN) While $iPos < $iLength $tPUSN_RECORD = DllStructCreate("dword RecordLength;word MajorVersion;word MinorVersion;uint64 FileReferenceNumber;uint64 ParentFileReferenceNumber;" & _ "uint64 Usn;uint64 TimeStamp;dword Reason;dword SourceInfo;dword SecurityId;dword FileAttributes;word FileNameLength;" & _ "word FileNameOffset;wchar FileName[256]", DllStructGetPtr($buffer)+$iPos) $sFileName = "" For $i = 1 to $tPUSN_RECORD.FileNameLength/2 $sFileName &= DllStructGetData($tPUSN_RECORD, "FileName", $i) Next ConsoleWrite ($sFileName & @CRLF) $iPos += $tPUSN_RECORD.RecordLength WEnd $MFT_ENUM_DATA.StartFileReferenceNumber = $USN.ptr WEnd DllClose($kernel32) ConsoleWrite("closing " & _WinAPI_CloseHandle($hVol) & @CRLF)1 point
-
What I did so far: #RequireAdmin=y #include <Array.au3> #include <WinAPIFiles.au3> #include <WinAPIHObj.au3> Global $VolName = "c:" Global Const $BUF_LEN = 4096 ;step 01. Determine whether the drive disk is in NTFS format Global $aData = _WinAPI_GetVolumeInformation() If $aData[4] <> "NTFS" Then Exit MsgBox($MB_ICONERROR, "ERROR", "This drive is not in NTFS format.") ;step 02. Get driver handle Global $hVol = _WinAPI_CreateFileEx("\\.\" & $VolName, _ $OPEN_EXISTING, _ BitOR( $GENERIC_READ, $GENERIC_WRITE), _ BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE), _ $FILE_ATTRIBUTE_READONLY) If $hVol Then ;step 03. Initialize USN Journal file Global $tCREATE_USN_JOURNAL_DATA = DllStructCreate("uint64 MaximumSize;uint64 AllocationDelta") If Not _WinAPI_DeviceIoControl($hVol, _ $FSCTL_CREATE_USN_JOURNAL, _ $tCREATE_USN_JOURNAL_DATA, _ DllStructGetSize($tCREATE_USN_JOURNAL_DATA)) Then ConsoleWrite(_WinAPI_GetLastErrorMessage() & @CRLF) _WinAPI_CloseHandle($hVol) Exit MsgBox($MB_ICONERROR, "ERROR", "Error to initialize USN Journal file") EndIf Global $br1 = @extended ;step 04. Get basic information of USN Journal Global $tUSN_JOURNAL_DATA = DllStructCreate("uint64 UsnJournalID;int64 FirstUsn;int64 NextUsn;int64 LowestValidUsn;int64 MaxUsn;uint64 MaximumSize;uint64 AllocationDelta") If Not _WinAPI_DeviceIoControl($hVol, _ $FSCTL_QUERY_USN_JOURNAL, _ Null, _ 0, _ $tUSN_JOURNAL_DATA, _ DllStructGetSize($tUSN_JOURNAL_DATA)) Then ConsoleWrite(_WinAPI_GetLastErrorMessage() & @CRLF) _WinAPI_CloseHandle($hVol) Exit MsgBox($MB_ICONERROR, "ERROR", "Failed to get basic information of USN Journal") EndIf Global $br2 = @extended ConsoleWrite("UsnJournalID: " & $tUSN_JOURNAL_DATA.UsnJournalID & @CRLF) ConsoleWrite("lowUsn: " & $tUSN_JOURNAL_DATA.FirstUsn & @CRLF) ConsoleWrite("highUsn: " & $tUSN_JOURNAL_DATA.NextUsn & @CRLF) ;step 05. Enumerate all records in USN Journal file Global $tMFT_ENUM_DATA_V0 = DllStructCreate("uint64 StartFileReferenceNumber;int64 LowUsn;int64 HighUsn") With $tMFT_ENUM_DATA_V0 .StartFileReferenceNumber = 0 .LowUsn = 0 .HighUsn = $tUSN_JOURNAL_DATA.NextUsn EndWith Global $usnDataSize, $dwRetBytes = 0, $i Global $tagPUSN_RECORD_V2 = "dword RecordLength;word MajorVersion;word MinorVersion;uint64 FileReferenceNumber;uint64 ParentFileReferenceNumber;" & _ "int64 Usn;int64 TimeStamp;dword Reason;dword SourceInfo;dword SecurityId;dword FileAttributes;word FileNameLength;" & _ "word FileNameOffset;wchar FileName[260]" Global $tBuffer = DllStructCreate("byte data[" & $BUF_LEN & "]") Global $tUSN = DllStructCreate("int64 Usn", DllStructGetPtr($tBuffer)) Global $iJFCount = 0 While _WinAPI_DeviceIoControl($hVol, _ $FSCTL_ENUM_USN_DATA, _ $tMFT_ENUM_DATA_V0, _ DllStructGetSize($tMFT_ENUM_DATA_V0), _ $tBuffer, _ DllStructGetSize($tBuffer)) $usnDataSize = @extended $dwRetBytes = $usnDataSize - DllStructGetSize($tUSN) Global $tUsnRecord = DllStructCreate($tagPUSN_RECORD_V2, DllStructGetPtr($tBuffer) + DllStructGetSize($tUSN)) While $dwRetBytes > 0 ConsoleWrite($tUsnRecord.Filename & @CRLF) $dwRetBytes -= $tUsnRecord.RecordLength $tUsnRecord = DllStructCreate($tagPUSN_RECORD_V2, DllStructGetPtr($tUsnRecord) + $tUsnRecord.RecordLength) $iJFCount += 1 WEnd $tMFT_ENUM_DATA_V0.StartFileReferenceNumber = $tUSN.ptr If $iJFCount > 1000 Then ExitLoop ;don't list all files WEnd ;step 06. Delete USN Journal file Global Const $USN_DELETE_FLAG_DELETE = 1 Global $tDELETE_USN_JOURNAL_DATA = DllStructCreate("uint64 UsnJournalID;dword DeleteFlags") With $tDELETE_USN_JOURNAL_DATA .UsnJournalID = $tUSN_JOURNAL_DATA.UsnJournalID .DeleteFlags = $USN_DELETE_FLAG_DELETE EndWith If Not _WinAPI_DeviceIoControl($hVol, _ $FSCTL_DELETE_USN_JOURNAL, _ $tDELETE_USN_JOURNAL_DATA, _ DllStructGetSize($tDELETE_USN_JOURNAL_DATA)) Then ConsoleWrite(_WinAPI_GetLastErrorMessage() & @CRLF) MsgBox($MB_ICONERROR, "ERROR", "Failed to delete USN Journal file") EndIf _WinAPI_CloseHandle($hVol) ConsoleWrite("Journal files count = " & $iJFCount & @CRLF) EndIf Seems to run but I'm not sure if output is valid...1 point
-
Eigen4AutoIt - Matrix computing with Eigen
argumentum reacted to RTFC for a topic
E4A Version 4.7 (the "Lockdown Release") is out. Get it now before stock runs out! This is a major update, thanks to having to spend way too much time in pandemic lockdown. The library now features over six hundred Eigen functions, over sixteen hundred alias wrappers, and well over two and a half thousand dll functions. This update beefs up integer functions in particular, notably in the context of bitmasks. So for once, no abstruse advanced mathematics. Some highlights: compiler, platform toolkit, and Windows SDK upgraded (long overdue); as a result, the dlls are no longer suffering from elephantiasis complete overhaul of CwiseLogicalOp functions, with new operators "nor" and "xcl" ("exclude"), and redundant operator "flip" removed (See the shiny truth tables below); also a new flag (see _Eigen_SetLogicalBit0only) to control whether these ops affect all (32) bits or just bit 0. I've also created an example script to illustrate how, in combination with bitmask functions (see _Eigen_ConditMask and variants, which now all have _InPlace counterparts as well), these can be leveraged to approach computationally hard, but mathematically simple problems. Output matrix dimensions have also been standardised where possible between all Cwise*Op and ConditMask functions. more vector support, including _Eigen_CreateCol/RowVector, _Eigen_IsVector, and _Eigen_CreateVector_FromAcell_Mask, which collects from an input matrix only those cell values that are masked in a separate bitmask matrix. In combination with _Eigen_FindAll (producing offset, row, and column of a targeted value) applied to the bitmask (so target value = 1), all relevant data satisfying a (simple or compound) bitmask condition can now be collected for further processing; most MatrixSpecs_Single functions (in section: Matrix Reduction) can now be accessed more easily through their own dedicated function; for example, _Eigen_IsZero, _EigenIsOnes, and _Eigen_GetSum have already proven to be timesavers that also make the code more easily understandable; the same goes for new functions that specifically retrieve the minimum/maximum value or their row/col. many matrix creation functions that use an existing matrix as input and result in a changed dimension now return that new size in macro @extended; likewise _Eigen_FindAll and _Eigen_Sort_Unique now return the number of results found in @extended. many corrections and clarifications in the online/chm Help pages. For full details, please consult the download page.1 point -
Both are good. Having a separate $sFilePath is useful if you need to refer to it often.1 point
-
Function Variables
seadoggie01 reacted to mLipok for a topic
It only confirms the saying "Don't be so sure"1 point -
1 point
-
Function Variables
seadoggie01 reacted to jchd for a topic
FuncName is your friend. Function-related functions: VarGetType, IsFunc, FuncName I'm requesting that VarGetType be listed under "Variables and conversion" rather under "Misc" in help file. Also "Dataypes" fail to list Function type as well as several other native datatypes.1 point -
Function Variables
seadoggie01 reacted to mLipok for a topic
_Example() Func _Example() Local $fnTesting = _test ConsoleWrite("! FunctionName = " & FuncName($fnTesting) & @CRLF) EndFunc ;==>_Example Func _test() EndFunc ;==>_test1 point -
The help file is your friend1 point
-
F1 in SciTE to open the Helpfile?1 point
-
Here what I wanted the cycle to be If i Right click press 1. If i Right click again press 2 If i Right click again press 3 Or maybe its. SendKey 1 If i press Right Click Send 2 If I press Right Click Send 3 Right click then go back to begining again. the Sendkey "1",2,3 is a number on top of letters. I Get Error on this one. TrayTip("[autocombo] F9 on f10 off.", 8 , 16) Opt ("SendKeyDelay", 1 ) HotKeySet ("{F9}", "combo" ) HotkeySet ("{F10}", "Stop" ) Func combo () If Mouseclick("Right") Then Send ("1", 1) If Mouseclick("Right") Then Send ("2", 1) If Mouseclick("Right") Then Send ("3", 1) MouseUp("Right") sleep(3) Send ("1", 1) EndFunc ;********** Stop ********** ; Stops The Program. Func Stop () While 1 = 1 Sleep (1000) Wend EndFunc1 point
-
Here an example also with "partial search" : #include <Array.au3> Local $sSearch, $aResult Local $aArray = ["Peter John Doe", "Martin", "Potter", "John", "Marta", "Lola", "John"] _ArrayDisplay($aArray, "SearchArray") ; *** just to display the array $sSearch = "John" ; Parameter $iCompare = 1 ==> executes a partial search ; ---------------------------------------------------------------V----------- $aResult = _ArrayFindAll($aArray, $sSearch, Default, Default, 0, 1, 0, False) _ArrayDisplay($aResult, "$iCompare = 1") ; *** just to display the array MsgBox(BitOR(4096,96), "Result 1 :", $sSearch & " was found " & UBound($aResult) & " time(s)" & @CRLF) ; Parameter $iCompare = 2 ==> comparison match same type and same value ; ---------------------------------------------------------------V----------- $aResult = _ArrayFindAll($aArray, $sSearch, Default, Default, 0, 2, 0, False) _ArrayDisplay($aResult, "$iCompare = 2") ; *** just to display the array MsgBox(BitOR(4096,96), "Result 2 :", $sSearch & " was found " & UBound($aResult) & " time(s)" & @CRLF)1 point
-
diff, If you declare the array correctly and read the Help file to see that _ArrayFindAll returns an array which does not display in a MsgBox, you get this: #include <Array.au3> Local $aArray = ["John", "Martin", "Potter", "John", "Marta", "Lola", "John"] $sName = "John" $aFindDup = _ArrayFindAll($aArray, $sName) _ArrayDisplay($aFindDup, "", Default, 8) MsgBox(0, "", UBound($aFindDup)) which works fine for me. M231 point
-
Or something like #include <Inet.au3> $x = _INetGetSource("https://www.zaba.hr/home/tecajna") $pos = StringInStr($x, "/home/ZabaUtilsWeb/utils/tecaj/txt/") $file = StringMid($x, $pos+35,8) InetGet("https://www.zaba.hr/ZabaUtilsWeb/utils/tecaj/txt/" & $file, StringReplace($file, "/", "-") & ".txt")1 point
-
To start you up : #include <IE.au3> #include <Constants.au3> Local $oIE = _IECreate("https://www.zaba.hr/home/tecajna") If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","Unable to load web page") Local $oDL = _IEGetObjById ($oIE, "txt") If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","TXT Object not found") $oDL = _IETagNameGetCollection($oDL, "a", 0) If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","DownLoad Object not found") _IEAction ($oDL, "click") Sleep (2000) Local $hWnd= _IEPropertyGet ($oIE, "hwnd") Local $hCtrl = ControlGetHandle ($hWnd, "", "DirectUIHWND1") ControlSend ($hWnd, "", $hCtrl, "{F6}{TAB}") Sleep (800) ControlSend ($hWnd, "", $hCtrl, "{ENTER}")1 point
-
ObjEvent - Bytescout.PDFExtractor.dll + ProgressEventHandler
Danyfirex reacted to argumentum for a topic
<double posted due to internet connection, snip>1 point -
@argumentum did you try ByteScout Trial version ? It works awesome for me. btw. My clients/endusers are interested in this solution.1 point
-
You cannot run this, the line will give you error: If $Var[$iAscii]A = IniRead ( "Variable", "$g$.$g$$g$", "Var$iAscii$A" ) Then I do not think it is necessary to use this Opt. Make sure you format your string correctly. To help you use some error handling messages (consoleWrite, msgBox). And stay away from assign and eval unless it is totally obviously advantageous.1 point
-
Function Variables
seadoggie01 reacted to mLipok for a topic
@seadoggie01 the best explanation / working usage in UDF which show exactly adequate example which is comparable to your snippet is in ErrorLog.au3 ....... Func _Log_SetOutputFunction($fnFunction = Default) Local Static $fnFunction_static = Null If $fnFunction = Default And IsFunc($fnFunction_static) Then Return $fnFunction_static If Not IsFunc($fnFunction) Then Return SetError(1) $fnFunction_static = $fnFunction Return $fnFunction_static EndFunc ;==>_Log_SetOutputFunction ....... Func __Log_Wrapper($sText) Local $fnFunction = _Log_SetOutputFunction() If @error Then Return SetError(1) $fnFunction($sText) EndFunc ;==>__Log_Wrapper ....... Using _Log_SetOutputFunction() and _Log() function which use __Log_Wrapper() you can on the fly change the "output device" for _Log() function. For example I use this following approach in all my projects : at starts it check if script is compiled and if not then is forwarding to ConsoleWrite() if is compiled but not entirely initiated "Diagnostic Log window" is not displayed no log is displayed if the "Diagnostic Log window" is displayed then the log is forwarded to this "Diagnostic Log window" if I run compiled script with parameters I can change the log output to file if I change "Diagnostic Log window" to use SciLexer.dll then I can ensure you that this will be very easy to forward log to NEW "Diagnostic Log window"1 point -
As about PNG support in GUICtrlCreatePic(), there is ResourceEx UDF for this, so you can do it simply by 4 lines of code: 1) embed PNG to resources - #AutoIt3Wrapper_Res_File_Add=png_1.png, RT_RCDATA, PNG_1, 0 2) include UDF - #include 'ResourcesEx.au3' 3) create empty Pic control - $iPic_1 = GUICtrlCreatePic('', 0, 0, 100, 100) 4) set PNG image from resources to Pic control - _Resource_SetToCtrlID($iPic_1, 'PNG_1')1 point
-
butterfly, You might find my code in this thread of interest as it deals with creating several identical GUIs within the same script. and how to keep track of them: But as argumentum says above, posting some code and explaining what does not work might well enable us to give some better focused help. M231 point
-
Hi everyone, Some good news for you among all the gloom of these virus-ridden times: Nine, Subz and Danyfirex have accepted the invitation to become MVPs. Please join me in congratulating them on their new status in our community. Keep safe out there, M231 point
-
IDispatch Object in Assembly
seadoggie01 reacted to argumentum for a topic
There are no issues or comments. But I have a ton of questions, like "What is a dispatch object ?", just to start. So, where can I read up on dispatch, at a kindergarten level1 point