Leaderboard
Popular Content
Showing content with the highest reputation since 07/12/2025 in Posts
-
Extract animated PNG (APNG) frames build 2025-07-31
SOLVE-SMART and 8 others reacted to UEZ for a topic
As the title says an UDF to extract the frames from an animated PNG (APNG) file. UDF: #include-once ; #FUNCTION# ==================================================================================================================== ; Name ..........: ExtractAPNG ; Version .......: build 2025-07-31 ; Description ...: Extracts the frames from an animated PNG file. ; Syntax ........: ExtractAPNG($sAPNGfile[, $sExtractedPath = @ScriptDir & "\ExtractedFrames"[, $iDefaultDelay = 50[, ; $sPath2DLL = ""]]]) ; Parameters ....: $sAPNGfile - a string value. ; $sExtractedPath - [optional] folder to save frames to. Default is @ScriptDir & "\ExtractedFrames". ; $iDefaultDelay - [optional] an integer value. Default is 50 ms. ; $sPath2DLL - [optional] a string value. Default is "". Path to the DLL. ; Return values .: number of extracted frames. If < 2 then error. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func ExtractAPNG($sAPNGfile, $sExtractedPath = @ScriptDir & "\ExtractedFrames", $iDefaultDelay = 50, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then If @AutoItX64 Then _Extract_APNG_Frames_x64dll(True) Else _Extract_APNG_Frames_x86dll(True) EndIf EndIf Local $hDLL = DllOpen($sDLL) Local $iReturn = DllCall($hDLL, "int", "ExtractAPNG", "str", $sAPNGfile, "str", $sExtractedPath, "ushort", $iDefaultDelay)[0] DllClose($hDLL) If $iReturn < 2 Then Return SetError(1, 0, $iReturn) Return $iReturn EndFunc ;==>ExtractAPNG ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: Path2DLL ; Description ...: Return the path to the Extract_APNG_Frames_x??.dll ; Author ........: UEZ ; Modified.......: ; Remarks .......: This function is used internally by Extract APNG Frames.au3 ; =============================================================================================================================== Func Path2DLL($sPath2DLL = "") Return $sPath2DLL ? $sPath2DLL : @ScriptDir & (@AutoItX64 ? "\Extract_APNG_Frames_x64.dll" : "\Extract_APNG_Frames_x86.dll") EndFunc ;==>Path2DLL ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _Extract_APNG_Frames_x64dll($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Extract_APNG_Frames_x64dll $Extract_APNG_Frames_x64dll &= 'DboATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAgAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGAFBFAABkhgsAEOXIi2gFV/AALoAiCwICIgCcAAyqzgADjgAnEwAHEAIebQcFAgO3AQAFAQwBANAiAQIUH7YBAtcAAD4gBCEFBwM+BQYGCoABBABagQOQAQCkD2EIctAAAKAELQIAwAgBAIiZicIAACjBkAvUkwEAcANIEgAgLnRleHSAAxiaDwRIgX0FbgQAYABQYGAuZGF0YYFmAHMAErCDgQCgixNAAGDIwC5yAxQQDoFZhCnioo4TQC5wwwnCOMA6hcIcss0JMEAueMMJKkzBCeDECbbQCWJzunPCKowCctSNwCdlwxPXwlzAXsIxutATacMJwmQLwGbCMbzOCcAuQ1KqVMECWAEBoMQTzM0JYEDALnRswifCfLAHxAnBmM0JcmVsb2O+AMN6wHzCCcFHyx1CoMkHPwA/ABYASI0N+d8AAADptCkAAA8AH0AAQVVBVFUAV1ZTSIPsKEkAicxNicWF0nUQeosV7IAEMcCFANJ+XoPqAUiLhB0UYD9FMeS/wVAIiRXOoANIiy3TAIQBAOsMDx9EEAAAueiAXf/VTACJ4PBID7E7SACJxkiFwHXpSACLPeq1AACLB0CD+AIPhO+AB7lSH4AA6C3AD7hhCUgAg8QoW15fXUEAXEFdww8fAIMg+gEPha8AA2VIEIsEJTAhBIsdl4FACEiLcAgx/4AOQl6BDhgPH4TjGTkwxg+Et+EKAxBIiSr4ARAzoQ/j4QU1aiHhDwaD+AHjD4sG4IXAD4SlIgGCAoFQIIX/D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AgyYNBABhYm9ydAAgBCOQJEEqAC0Ecw4xBAJm9AoyBGZlb2ZRUAMEZmbQP2iQZwQmZjAKAEwAN5IAcwAAPgRmb3BlbgAgQwRmcHXwAEYEsmbBNgBHcQAwBEhxACESAk4EZnOzA1MEzGZ3MCzQAVYE' $Extract_APNG_Frames_x64dll &= 'QASwBwiCBG1UCIUEbWIQc3RvdxFTiQRtVGVt0gyKkgBw8BqLgZEAbW92ZQCMkQABEAUAAJMEcHJpJG50kAqXBEIIAJ5mBEAIAgWmBCACgABhBQAVp7EAdmJ1ZgAAqARzaWduYWzwAAC9BCATsBpQj5EAGm7hBsGTAOAG3gR1Qm4TCuAEdmZVBvU2BOAJMgP4kQAyAwUFCZAAdG/ACwAAEQAgQ0xTSUQEY2luMGcAoACzYvNjT25+SEM/wmowaT8APwA4AGeB01guZGxsABTwAP8/AD8APwA/AD8APwA/ADcAAEtFUk5FTDMy/4IJcX0wAT8APwA/AD8APwD/PwA/AD8APwA/AD8APwAxAEBtc3ZjcnTTDjz/8AAxACBPBxAPAA8ADwAPADcPAA8ABQAQEAAPAADQ+pRzAaB0AA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8AAw8AAwCTsAAAoAAAEAAAAEDoqfCpCKoAgLAIAAAsADAQoBigACCgQKBIoFCgAFigYKBooHCgAHiggKCIoJCgAJigqKDAoPCgIADAAAA8AFZQogBYomCigKKIogCQopiiwKXQpQDgpfClAKYQpgAgpjCmQKZQpgBgpnCmgKaQpgCgprCmwKbQpgkAaKABAu4YoDCgDjgAg/8AcwA=' $Extract_APNG_Frames_x64dll = _WinAPI_Base64Decode($Extract_APNG_Frames_x64dll) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Extract_APNG_Frames_x64dll) & ']') DllStructSetData($tSource, 1, $Extract_APNG_Frames_x64dll) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 53760) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Extract_APNG_Frames_x64.dll", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Extract_APNG_Frames_x64dll Func _Extract_APNG_Frames_x86dll($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Extract_APNG_Frames_x86dll $Extract_APNG_Frames_x86dll &= 'SrkATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAgAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGAFBFAABMAQkAENHIi2gFV+AADoAjCwECIgCaAAyCwAADXgAAsBMAB6oQAAOwAiIQAgsCA7ceAQS/A5QADQAMGogBHwLXAzQEAwEGBA0AMAGEAFoC6AEAYAsYcjBwAQDIBi4PACjCCAAAGBEMQgEAnIMBTBQALnRleHSAAxz8mQRIgXWMM2AAUEBgLmRhdGGABXwnAQiBfYB5AJ6LE0AAkGDALnIDFIAKhJkKDIABoI4TQC5ic9JzgQXcXQAC0JXrwBNeZcMTwkjASsIdrM0TMHhALmnDCcJQwFLCHa5BzgnALkNSVMECLEsCfcQTutAJdGzCJwgLAkDECbzQCXJlbG9MYwDDZsBoAAbAAb59zglCoLE/AD8APwA0AIMg7BzHBCQgQRDoBHEtwAHEHMONtBImIQONtqEAV1ZTAIPsEItEJCSFQMB1cosVDCAFhQDSfleD6gEx/8q+AVyJYgLrFuMFgAkC6OBu/xWYQgEQAIPsBIn48A+xgDXULQEQicMgCAjgodhAAYP4Ag+UhOKjBR/AAOjqwEICuIEJg8QQW15fCMIMAIQQkIP4AUgPhacgA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lzqxOgDROvc6BDsqOwBNO1U7XDtoOwCjO6w73zspPABFPEw8WDxfPAD4PBg9Hz0oPQAvPag9yD3PPQDYPd89AJAAAALAAJuQNTY3RzcAUTdYN2o3dzcAhTeUN5k3sTcAvTfDN8031jcA8Df5NxI4UTgAZDhrOJY4qzgAtzjYOPE4AjkAaDqGOqE6sjoIujrCgD70Ovo6ACg7ODtCO0c7IEw7WztggEFxOwB7O4E7ijubOwAHPBQ8OTw+PADbPBo9Jz1dPQB5PZk9uj3QPQDvPfw9Az4YPgAqPj4+Wj5yPgCWPqg+rT6yPgC9Pss+8z4VPwAqPzA/Nj9XPwBpP3E/fT+CPwCTP70/wz/RPxDfP/I/AFygAAAC+AADITBhMGcwAIIwiDCTMJkwAKkwuTDaMOAwAOYw8zD5MCgxAC4xQTF1MYQxAIkxjzGcMaIxAMUx4zHpMe4xACMyKTJCMmgyAHIyjjKjMqkyALky' $Extract_APNG_Frames_x86dll &= 'xzLSMvMyAP0yCDMOM90zAOYz9DP7MwI0AAk0ZTRvNH40AIk0kDSWNJ00AOU07jT8NAM1ABo1IzUxNTg1AD81RjV1NX41AIo1pTWvNb81AMo10TXXNd41ADY2RTZTNlk2AF82oTbQNvY3AAA4EDjCOMo4ANI42jjiOOo4CPI4+kBRCjkSOQAaOSI5KjkyOQA6OUI5SjlSOQBaOWI5ajlyOQB6OYI5ijmSOQCaOaI5qjmyOQDJOeQ56Dn0OSAAsAAALMA9BDAACDAMMCAwJDAAKDAsMDAwNDAAODA8MEAwRDAASDBMMFQwYDAUcDABeBjAChwyIAAyJDIoMiwyMAgyNDIABFABABCBgAEMMBgwHDAAAh8/AD8APwA/ACwA' $Extract_APNG_Frames_x86dll = _WinAPI_Base64Decode($Extract_APNG_Frames_x86dll) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Extract_APNG_Frames_x86dll) & ']') DllStructSetData($tSource, 1, $Extract_APNG_Frames_x86dll) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 50176) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Extract_APNG_Frames_x86.dll", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Extract_APNG_Frames_x86dll Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress Example: #AutoIt3Wrapper_UseX64=n #include <InetConstants.au3> #include <MsgBoxConstants.au3> #include "Extract APNG Frames.au3" Global $sExampleFile = @ScriptDir & "\Animated_PNG_example_bouncing_beach_ball.png" Global $sDestPath = @ScriptDir & "\ExtractedFrames" If Not FileExists($sExampleFile) Then InetGet("https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png", $sExampleFile, $INET_BINARYTRANSFER) EndIf Global $iResult = ExtractAPNG($sExampleFile, $sDestPath) If $iResult > 1 Then MsgBox($MB_ICONNONE, "APNG Extraction", $iResult & " frames were extracted to " & $sDestPath, 30) Else MsgBox($MB_ICONERROR, "APNG Extraction", "Extraction of frames has failed: " & $iResult, 30) EndIf The needed DLLs are in the UDF and will be extracted to script dir on first usage. DLL is written in Freebasic by me. 😉 History: 2025-07-29: first releas 2025-07-30: bug fixed when $sExtractedPath is empty. If empty current dir will be used to save frames. You must delete old DLLs.9 points -
I’m thrilled to introduce my IStream UDF, a sophisticated library designed to handle the COM IStream interface in AutoIt. This UDF enables management of data streams, whether from files, memory, or other sources, leveraging Windows IStream APIs. It provides a reliable solution for reading, writing, and administering streams in your AutoIt scripts. Whether you need to process large files, manipulate in-memory data, or handle transactional streams, this UDF is crafted to be versatile, well-documented, and user-friendly.Key Features Full Implementation of the IStream Interface: Supports all methods of the IStream interface (Read, Write, Seek, SetSize, CopyTo, Commit, Revert, LockRegion, UnlockRegion, Stat, Clone). Support for File and Memory Streams: Create streams from files using _SHCreateStreamOnFileEx or from in-memory data with _StreamCreateFromData, _SHCreateMemStream, and _StreamCreateFromDataOnHGlobal. Advanced Error Handling: Includes a detailed HRESULT error table ($tagIStreamErrorTable) and a _IStream_GetErrorInfo function for clear, understandable error messages. Utility Functions: Functions like _StreamGetSize, _StreamGetName, _StreamGetType, and _StreamStatDisplay simplify access to stream metadata. Comprehensive Documentation: Each function comes with standard UDF-format documentation, including syntax, parameters, return values, remarks, MSDN links, and practical examples. Compatibility: Works with AutoIt 3.3+ and relies on standard libraries (AutoItObject, WinAPI, Memory, Date). Use Cases Reading and writing large files without loading their entire content into memory. Handling in-memory binary data for applications such as network stream processing or serialized data manipulation. Supporting transactional streams for secure operations (e.g., via StgCreateDocfile). Integration with other COM interfaces requiring IStream. you need: AutoItObject.au3 Example: copy data between streams #include "IStream.au3" ; Example demonstrating the use of _StreamCopyToEx to copy data between streams Func Example_StreamCopyToEx() ; Create a source stream with the content "Strong" using _StreamCreateFromDataOnHGlobal ConsoleWrite("Creating source stream with 'Strong'..." & @CRLF) Local $iSrcSize,$aError Local $oSrcStream = _StreamCreateFromDataOnHGlobal("Strong", $iSrcSize, True) If @error Or Not IsObj($oSrcStream) Then ; Handle errors by displaying the HRESULT code and details from $tagIStreamErrorTable ConsoleWrite("Error: Failed to create source stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf Return EndIf ConsoleWrite("Source stream created, size: " & $iSrcSize & " bytes" & @CRLF) ; Create a destination stream with the content "AutoIt is " using _StreamCreateFromDataOnHGlobal ConsoleWrite("Creating destination stream with 'AutoIt is '..." & @CRLF) Local $iDestSize Local $oDestStream = _StreamCreateFromDataOnHGlobal("AutoIt is ", $iDestSize, True) If @error Or Not IsObj($oDestStream) Then ; Handle errors for destination stream creation ConsoleWrite("Error: Failed to create destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release the source stream and COM resources before exiting _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Destination stream created, size: " & $iDestSize & " bytes" & @CRLF) ; Copy the content from the source stream to the destination stream using _StreamCopyToEx ConsoleWrite("Copying 'Strong' to destination stream..." & @CRLF) Local $iBytesRead, $iBytesWritten If Not _StreamCopyToEx($oSrcStream, $oDestStream, $iSrcSize, $iBytesRead, $iBytesWritten) Then ; Handle errors during the copy operation ConsoleWrite("Error: _StreamCopyToEx failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release both streams and COM resources before exiting _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Copied " & $iBytesRead & " bytes read, " & $iBytesWritten & " bytes written." & @CRLF) ; Read and display the content of the destination stream ConsoleWrite("Reading destination stream content..." & @CRLF) Local $iNewDestSize = _StreamGetSize($oDestStream) If @error Then ; Handle errors when retrieving the destination stream size ConsoleWrite("Error: Failed to get destination stream size. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release both streams and COM resources before exiting _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Destination stream size after copy: " & $iNewDestSize & " bytes" & @CRLF) ; Position the stream pointer at the beginning for reading Local $pDestMem, $iDestRead _StreamSeek($oDestStream, 0, $STREAM_SEEK_SET) If @error Then ; Handle errors when seeking in the destination stream ConsoleWrite("Error: Failed to seek destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ; Read the content of the destination stream _StreamRead($oDestStream, $iNewDestSize, $pDestMem, $iDestRead) If @error Then ; Handle errors when reading the destination stream ConsoleWrite("Error: Failed to read destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Free the memory buffer if allocated, then release streams and COM resources If $pDestMem Then _MemGlobalFree($pDestMem) _StreamRelease($oDestStream) _StreamRelease($oSrcStream) _WinAPI_CoUninitialize() Return EndIf ; Convert the read data to a string and display it Local $bufSize Local $bDestData = _WinAPI_GetBufferData($pDestMem, $bufSize) ConsoleWrite("Destination stream content: " & BinaryToString($bDestData, 4) & @CRLF) ; Free the memory buffer If $pDestMem Then _MemGlobalFree($pDestMem) ; Release both streams to prevent memory leaks _StreamRelease($oDestStream) _StreamRelease($oSrcStream) ConsoleWrite("COM uninitialized, resources freed." & @CRLF) EndFunc ;==>Example_StreamCopyToEx ; Run the example Example_StreamCopyToEx() example demonstrating multiple IStream interface methods #include "IStream.au3" ; Example demonstrating multiple IStream interface methods Func Example_IStream() ; Initialize the COM object model (required for COM API calls) _WinAPI_CoInitialize() ConsoleWrite("=== Creating Stream with SHCreateMemStream ===" & @CRLF) ; Create a memory stream with initial content "Hello, IStream UDF!" Local $sData = "Hello, IStream UDF!" Local $iSize = 0 Local $oStream = _StreamCreateFromData($sData, $iSize) If @error Then ; Handle stream creation error and display details ConsoleWrite("Error: Failed to create stream. @error = " & @error & @CRLF) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Stream created successfully. Size: " & $iSize & " bytes" & @CRLF) ; Test IUnknown::QueryInterface to verify the IStream interface ConsoleWrite("Testing QueryInterface..." & @CRLF) Local $IID_IStream = "{0000000C-0000-0000-C000-000000000046}" Local $pQueriedStream = _StreamQueryInterface($oStream, $IID_IStream) If @error Then ; Handle QueryInterface error and release resources ConsoleWrite("Error: QueryInterface failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("QueryInterface succeeded." & @CRLF) ; Release the queried interface to prevent memory leaks DllCall("ole32.dll", "ulong", "Release", "ptr", $pQueriedStream) ; Test IStream::Write by appending additional data ConsoleWrite("Testing Write..." & @CRLF) Local $sNewData = " Additional data." ; 16 characters Local $iNewSize = 0 Local $pMemory = _StreamCreateMemoryBuffer($sNewData, $iNewSize) If @error Then ; Handle memory buffer creation error ConsoleWrite("Error: Failed to create memory buffer. @error = " & @error & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $iWrittenSize = 0 ; Set the stream size to accommodate new data If Not _StreamSetSize($oStream, $iSize + $iNewSize) Then ConsoleWrite("Error: SetSize failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Move the stream pointer to the end for appending If Not _StreamSeek($oStream, $iSize, $STREAM_SEEK_SET) Then ConsoleWrite("Error: Seek failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Write the new data to the stream If Not _StreamWrite($oStream, $pMemory, $iNewSize, $iWrittenSize) Then ConsoleWrite("Error: Write failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Wrote " & $iWrittenSize & " bytes." & @CRLF) ; Free the memory buffer _WinAPI_FreeMemory($pMemory) ; Test IStream::Seek to move the pointer to the beginning ConsoleWrite("Testing Seek..." & @CRLF) Local $iNewPosition = _StreamSeek($oStream, 0, $STREAM_SEEK_SET) If @error Then ConsoleWrite("Error: Seek failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Stream pointer moved to: " & $iNewPosition & @CRLF) ; Test IStream::Read to retrieve the entire stream content ConsoleWrite("Testing Read..." & @CRLF) Local $pMemoryRead = 0, $iReadSize = 0 If Not _StreamRead($oStream, $iSize + $iNewSize, $pMemoryRead, $iReadSize) Then ConsoleWrite("Error: Read failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemoryRead) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $bData = _WinAPI_GetBufferData($pMemoryRead, $iReadSize) ConsoleWrite("Read " & $iReadSize & " bytes: " & BinaryToString($bData) & @CRLF) _WinAPI_FreeMemory($pMemoryRead) ; Verify that the read data matches the expected content If $iReadSize <> $iSize + $iNewSize Or BinaryToString($bData) <> $sData & $sNewData Then ConsoleWrite("Error: Read data does not match expected: " & $sData & $sNewData & @CRLF) EndIf ; Test IStream::CopyTo by copying the stream to a new destination stream ConsoleWrite("Testing CopyTo..." & @CRLF) ; Create a destination stream Local $pDestStream = _WinAPI_CreateStreamOnHGlobal(0, True) If Not $pDestStream Then ConsoleWrite("Error: Failed to create destination stream." & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Move the source stream pointer to the beginning $iNewPosition = _StreamSeek($oStream, 0, $STREAM_SEEK_SET) If @error Then ConsoleWrite("Error: Seek failed on source stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Copy the content to the destination stream Local $iBytesRead = 0, $iBytesWritten = 0 If Not _StreamCopyTo($oStream, $pDestStream, $iSize + $iNewSize, $iBytesRead, $iBytesWritten) Then ConsoleWrite("Error: CopyTo failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Copied " & $iBytesRead & " bytes read, " & $iBytesWritten & " bytes written." & @CRLF) ; Create an IStream object from the destination stream pointer Local $oDestStream = _AutoItObject_WrapperCreate($pDestStream, $tagIStream) If @error Then ConsoleWrite("Error: Failed to create destination stream object. @error = " & @error & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Read and verify the destination stream content _StreamSeek($oDestStream, 0, $STREAM_SEEK_SET) Local $pDestMemory, $iDestReadSize If Not _StreamRead($oDestStream, $iSize + $iNewSize, $pDestMemory, $iDestReadSize) Then ConsoleWrite("Error: Reading destination stream failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pDestMemory) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $bDestData = _WinAPI_GetBufferData($pDestMemory, $iDestReadSize) ConsoleWrite("Destination stream content: " & BinaryToString($bDestData, $SB_UTF8) & @CRLF) _WinAPI_FreeMemory($pDestMemory) ; Verify that the copied data matches the expected content ; Test IStream::Commit ConsoleWrite("Testing Commit..." & @CRLF) If Not _StreamCommit($oDestStream, $STGC_DEFAULT) Then ConsoleWrite("Error: Commit failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Commit succeeded." & @CRLF) EndIf ; Test IStream::Revert ConsoleWrite("Testing Revert..." & @CRLF) If Not _StreamRevert($oDestStream) Then ; Note that Revert may not be supported by memory streams ConsoleWrite("Note: Revert may not be supported. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Revert succeeded (unexpected for memory stream)." & @CRLF) EndIf ; Test IStream::LockRegion and UnlockRegion ConsoleWrite("Testing LockRegion..." & @CRLF) If Not _StreamLockRegion($oStream, 0, 10, 0) Then ; Note that LockRegion may not be supported by memory streams ConsoleWrite("Note: LockRegion may not be supported. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) __IStreamErrorInfo(@extended) Else ConsoleWrite("LockRegion succeeded." & @CRLF) ConsoleWrite("Testing UnlockRegion..." & @CRLF) If Not _StreamUnlockRegion($oStream, 0, 10, 0) Then ConsoleWrite("Error: UnlockRegion failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("UnlockRegion succeeded." & @CRLF) EndIf EndIf ; Test IStream::Stat to retrieve stream metadata ConsoleWrite("Testing GetStat..." & @CRLF) Local $pStatFlag = 0 If Not _StreamGetStat($oStream, $pStatFlag) Then ConsoleWrite("Error: GetStat failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Displaying stream metadata:" & @CRLF) _StreamStatDisplay($pStatFlag) _WinAPI_CoTaskMemFree($pStatFlag) ; Test IStream::GetType and GetName ConsoleWrite("Testing GetType and GetName..." & @CRLF) Local $sType = _StreamGetType($oStream) If @error Then ConsoleWrite("Error: GetType failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Stream type: " & $sType & @CRLF) EndIf Local $sName = _StreamGetName($oStream) If @error Then ConsoleWrite("Error: GetName failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Stream name: " & $sName & @CRLF) EndIf ; Test IStream::Clone ConsoleWrite("Testing Clone..." & @CRLF) Local $pCloned Local $oCloneStream = _StreamClone($oStream, $pCloned) If @error Then ConsoleWrite("Error: Clone failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Clone stream created successfully." & @CRLF) _StreamRelease($oCloneStream) DllCall("ole32.dll", "ulong", "Release", "ptr", $pCloned) ; Clean up all resources _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() ConsoleWrite("All streams released and COM uninitialized." & @CRLF) EndFunc ;==>Example_IStream ; Run the example Example_IStream() The help file is included with the UDF IStream.zip New update Description: The IStream2 UDF (Interface Stream User Defined Function) is an AutoIt library designed to create, manipulate, and interact with IStream COM objects, implementing all methods of the IStream interface defined by Microsoft. This interface enables operations such as reading, writing, seeking, and copying on data streams, whether file-based or in-memory. Version 2 of this UDF has been optimized for native AutoIt usage, removing the dependency on AutoItObject.au3, making it lighter, self-contained, and more accessible.The UDF provides robust error handling through HRESULT codes, well-defined constants for COM flags (STGM, STGC, etc.), and comprehensive documentation for each function. It is ideal for developers looking to manipulate data streams in various contexts, such as file processing, memory management, or integration with structured storage systems. The previous version has been retained for compatibility reasons. This version 2 is designed to be fully compatible with any development using the IStorage interface, while avoiding data conflicts. IStream2.au36 points
-
I played around a bit, and ended up with this analog clock. ; https://www.autoitscript.com/forum/topic/213036-%F0%9F%95%91-analog-clock/ ;---------------------------------------------------------------------------------------- ; Title...........: AnalogClockGdi.au3 ; Description.....: A simple AutoIt script creating a digital analog clock GUI. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.1 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Math.au3> #include <Array.au3> #include <StaticConstants.au3> Global $hGUI, $hGraphic ; main GUI Global $hGUIBack, $hGraphicBack ; background GUI Global $hPenSeconds, $hPenMinutes, $hPenHours, $hBrushCenter _GDIPlus_Startup() _CreateClock(600) Func _DrawClock($iWidth, $iX = -1, $iY = -1) Local $iHeight = $iWidth $hGUI = GUICreate("Analog Clock", $iWidth, $iHeight, $iX, $iY, $WS_POPUP, $WS_EX_LAYERED, $hGUIBack) GUISetBkColor(0x00FFFF) ; 0x00FFFF _WinAPI_SetLayeredWindowAttributes($hGUI, 0x00FFFF) ; 0x00FFFF GUISetState(@SW_SHOW) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPenSeconds = _GDIPlus_PenCreate(0xFFFF0000, 2) $hPenMinutes = _GDIPlus_PenCreate(0xFF0000FF, 8) $hPenHours = _GDIPlus_PenCreate(0xFF00FF00, 12) $hBrushCenter = _GDIPlus_BrushCreateSolid(0xFF000000) Local $sTime, $Tick = -1 While True If $Tick <> @SEC Then $sTime = @HOUR & ":" & @MIN & ":" & @SEC ConsoleWrite("- " & $sTime & @CRLF) $Tick = @SEC _RedrawClock($iWidth) EndIf Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GDIPlus_GraphicsDispose($hGraphicBack) _GDIPlus_PenDispose($hPenSeconds) _GDIPlus_PenDispose($hPenMinutes) _GDIPlus_PenDispose($hPenHours) _GDIPlus_BrushDispose($hBrushCenter) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>_DrawClock Func _RedrawClock($iWidth) Local $iHeight = $iWidth Local $iCenterX = $iWidth / 2 Local $iCenterY = $iHeight / 2 Local $iClockRadius = $iWidth * 0.5 Local $hTransparentBrush = _GDIPlus_BrushCreateSolid(0xFF00FFFF) _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iWidth, $iHeight, $hTransparentBrush) _GDIPlus_BrushDispose($hTransparentBrush) Local $iCurrentHour = @HOUR Local $iCurrentMinute = @MIN Local $iCurrentSecond = @SEC Local $iDisplayHour = $iCurrentHour If $iDisplayHour > 12 Then $iDisplayHour -= 12 Local $fAngleHours = ($iDisplayHour * 30) - 90 _DrawHand($hGraphic, $hPenHours, $iCenterX, $iCenterY, $iClockRadius * 0.5, $fAngleHours) Local $fAngleMinutes = ($iCurrentMinute * 6) - 90 _DrawHand($hGraphic, $hPenMinutes, $iCenterX, $iCenterY, $iClockRadius * 0.7, $fAngleMinutes) Local $fAngleSeconds = ($iCurrentSecond * 6) - 90 _DrawHand($hGraphic, $hPenSeconds, $iCenterX, $iCenterY, $iClockRadius * 0.8, $fAngleSeconds) Local $iBulletRadius = 10 _GDIPlus_GraphicsFillEllipse($hGraphic, $iCenterX - $iBulletRadius, $iCenterY - $iBulletRadius, $iBulletRadius * 2, $iBulletRadius * 2, $hBrushCenter) EndFunc ;==>_RedrawClock Func _DrawHand($hGraphic, $hPen, $iX1, $iY1, $iLength, $fAngleDegrees) Local $fAngleRadians = _Radian($fAngleDegrees) Local $iX2 = $iX1 + ($iLength * Cos($fAngleRadians)) Local $iY2 = $iY1 + ($iLength * Sin($fAngleRadians)) _GDIPlus_GraphicsDrawLine($hGraphic, $iX1, $iY1, $iX2, $iY2, $hPen) EndFunc ;==>_DrawHand Func _CreateClock($iWidth, $iX = -1, $iY = -1) Local $iHeight = $iWidth $hGUIBack = GUICreate("Clock Background", $iWidth, $iHeight, $iX, $iY, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW)) GUISetBkColor(0x00FFFF) ; 0x00FFFF _WinAPI_SetLayeredWindowAttributes($hGUIBack, 0x00FFFF) ; 0x00FFFF GUISetState(@SW_SHOW) ; Get the graphic context for the background GUI $hGraphicBack = _GDIPlus_GraphicsCreateFromHWND($hGUIBack) _GDIPlus_GraphicsSetSmoothingMode($hGraphicBack, $GDIP_SMOOTHINGMODE_HIGHQUALITY) Local $iCenterX = $iWidth / 2 Local $iCenterY = $iHeight / 2 Local $iClockRadius = $iWidth * 0.5 Local $iTextRadius = $iClockRadius * 0.90 ; Adjust this value for number placement (closer to edge) For $i = 1 To 12 Local $sDigit = $i Local $fAngleDegrees = ($i * 30) - 90 Local $fAngleRadians = _Radian($fAngleDegrees) Local $iTextX = $iCenterX + ($iTextRadius * Cos($fAngleRadians)) Local $iTextY = $iCenterY + ($iTextRadius * Sin($fAngleRadians)) Local $iDigitWidth = 36 ; Estimate based on font size 30 Local $iDigitHeight = 30 ; Estimate based on font size 30 ; Draw the number - 0xFFFFFFFF = White color for numbers (ARGB) _GDIPlus_GraphicsDrawString($hGraphicBack, $sDigit, $iTextX - ($iDigitWidth / 2), $iTextY - ($iDigitHeight / 2), "Arial", 30, Default, 0xFFFFFFFF) Next _DrawClock($iWidth, $iX, $iY) EndFunc ;==>_DrawStaticClockBackground Which I "tweaked" a bit, and ended up with this ; https://www.autoitscript.com/forum/topic/213036-%F0%9F%95%91-analog-clock/ ;---------------------------------------------------------------------------------------- ; Title...........: Analog_Clock.au3 ; Description.....: A simple AutoIt script creating a digital analog clock GUI with alarm functionality. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.1 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Math.au3> #include <Array.au3> #include <StaticConstants.au3> #include <TrayConstants.au3> #include <Misc.au3> Opt("TrayMenuMode", 3) ; 0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return Global $hGuiParent, $hGUIBack, $idBackTheme ; Parent GUI & background GUI Global $hGUI, $hGraphic ; main clock GUI Global $hPenSeconds, $hPenMinutes, $hPenHours, $hBrushCenter Global $mAlarm = _GetClockSetting(StringTrimRight(@ScriptFullPath, 4) & ".ini") _GDIPlus_Startup() _CreateClock($mAlarm.width, $mAlarm.x, $mAlarm.y) ;--------------------------------------------------------------------------------------- Func _DrawClock($iWidth, $iX = -1, $iY = -1) Local $hDLL = DllOpen("user32.dll") ; for _IsPressed ; Tray Menou Local $idMove = TrayCreateItem("Move") Local $idSetAlarm = TrayCreateItem("Alarm Setting") Local $idAlarmActive = TrayCreateItem("Alarm Enable/Disable") TrayItemSetState($idAlarmActive, ($mAlarm.active = "1" ? $TRAY_CHECKED : $TRAY_UNCHECKED)) Local $idClockSetting = TrayCreateItem("Clock Setting") TrayCreateItem("") ; separator ----------------------- Local $idClose = TrayCreateItem("Close") TraySetClick($TRAY_CLICK_SECONDARYUP) TraySetIcon("mmcndmgr.dll", -15) TraySetToolTip("Analog Clock") TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. ; Clock GUI $hGUI = GUICreate("Analog Clock", $iWidth, $iWidth, $iX, $iY, $WS_POPUP, $WS_EX_LAYERED, $hGuiParent) GUISetBkColor(0x00FFFF) ; 0x00FFFF _WinAPI_SetLayeredWindowAttributes($hGUI, 0x00FFFF) ; 0x00FFFF GUISetState(@SW_SHOW) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPenSeconds = _GDIPlus_PenCreate(0xFFFF0000, 2) ; 0xFFFF0000 $hPenMinutes = _GDIPlus_PenCreate(0xFF0000FF, 8) ; 0xFF0000FF $hPenHours = _GDIPlus_PenCreate(0xFF008000, 12) ; 0xFF00FF00 $hBrushCenter = _GDIPlus_BrushCreateSolid(0xFF000000) ; 0xFF000000 Local $Tick = -1, $Tack = -1 While True If $Tick <> @SEC Then $Tick = @SEC _RedrawClock($iWidth) EndIf If $Tack <> @MIN Then $Tack = @MIN _CheckAlarm() EndIf Switch TrayGetMsg() Case $idClose ExitLoop Case $idMove WinActivate($hGuiParent) While 1 Local $aMpos = MouseGetPos() WinMove($hGuiParent, '', $aMpos[0], $aMpos[1]) ToolTip("click to drop it", $aMpos[0] + 30, $aMpos[1] - 10) If _IsPressed("01", $hDLL) Then ExitLoop ; 01 Left mouse button Sleep(10) WEnd ToolTip("") $mAlarm.x = $aMpos[0] $mAlarm.y = $aMpos[1] IniWrite($mAlarm.file, "ClockSetting", "x", $aMpos[0]) IniWrite($mAlarm.file, "ClockSetting", "y", $aMpos[1]) Case $idAlarmActive If BitAND(TrayItemGetState($idAlarmActive), $TRAY_CHECKED) Then ; If $TRAY_CHECKED TrayItemSetState($idAlarmActive, $TRAY_UNCHECKED) IniWrite($mAlarm.file, "ClockSetting", "active", "0") $mAlarm.active = "0" Else ; If $TRAY_UNCHECKED TrayItemSetState($idAlarmActive, $TRAY_CHECKED) IniWrite($mAlarm.file, "ClockSetting", "active", "1") $mAlarm.active = "1" EndIf Case $idSetAlarm _SetAlarm() Case $idClockSetting ShellExecute($mAlarm.file) Case $TRAY_EVENT_PRIMARYDOUBLE WinActivate($hGuiParent) EndSwitch WEnd DllClose($hDLL) _GDIPlus_PenDispose($hPenSeconds) _GDIPlus_PenDispose($hPenMinutes) _GDIPlus_PenDispose($hPenHours) _GDIPlus_BrushDispose($hBrushCenter) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>_DrawClock ;--------------------------------------------------------------------------------------- Func _RedrawClock($iWidth) Local $iHeight = $iWidth Local $iCenterX = $iWidth / 2 Local $iCenterY = $iHeight / 2 Local $iClockRadius = $iWidth * 0.45 Local $hTransparentBrush = _GDIPlus_BrushCreateSolid(0xFF00FFFF) ;0xFF00FFFF _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iWidth, $iHeight, $hTransparentBrush) _GDIPlus_BrushDispose($hTransparentBrush) Local $iCurrentHour = @HOUR Local $iCurrentMinute = @MIN Local $iCurrentSecond = @SEC Local $iDisplayHour = $iCurrentHour If $iDisplayHour > 12 Then $iDisplayHour -= 12 Local $fAngleHours = ($iDisplayHour * 30) - 90 _DrawHand($hGraphic, $hPenHours, $iCenterX, $iCenterY, $iClockRadius * 0.5, $fAngleHours) Local $fAngleMinutes = ($iCurrentMinute * 6) - 90 _DrawHand($hGraphic, $hPenMinutes, $iCenterX, $iCenterY, $iClockRadius * 0.7, $fAngleMinutes) Local $fAngleSeconds = ($iCurrentSecond * 6) - 90 _DrawHand($hGraphic, $hPenSeconds, $iCenterX, $iCenterY, $iClockRadius * 0.8, $fAngleSeconds) Local $iBulletRadius = 10 _GDIPlus_GraphicsFillEllipse($hGraphic, $iCenterX - $iBulletRadius, $iCenterY - $iBulletRadius, $iBulletRadius * 2, $iBulletRadius * 2, $hBrushCenter) EndFunc ;==>_RedrawClock ;--------------------------------------------------------------------------------------- Func _DrawHand($hGraphic, $hPen, $iX1, $iY1, $iLength, $fAngleDegrees) Local $fAngleRadians = _Radian($fAngleDegrees) Local $iX2 = $iX1 + ($iLength * Cos($fAngleRadians)) Local $iY2 = $iY1 + ($iLength * Sin($fAngleRadians)) _GDIPlus_GraphicsDrawLine($hGraphic, $iX1, $iY1, $iX2, $iY2, $hPen) EndFunc ;==>_DrawHand ;--------------------------------------------------------------------------------------- Func _CreateClock($iWidth, $iX = -1, $iY = -1) $hGuiParent = GUICreate("GuiParent", 10, 10, $iX, $iY, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT)) $hGUIBack = GUICreate("GUIBack", $iWidth, $iWidth, 10 - ($iWidth / 2), 10 - ($iWidth / 2), $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGuiParent) $idBackTheme = GUICtrlCreatePic(@ScriptDir & "\Clock-600.gif", 0, 0, $iWidth, $iWidth) GUISetState(@SW_SHOW, $hGUIBack) GUISetState(@SW_SHOW, $hGuiParent) Local $aPos = WinGetPos($hGuiParent) _DrawClock($iWidth, $aPos[0] - ($iWidth / 2) + 5, $aPos[1] - ($iWidth / 2) + 5) EndFunc ;==>_CreateClock ;--------------------------------------------------------------------------------------- Func _GetClockSetting($sIniPath) If Not FileExists($sIniPath) Then ; make one Local $sTxt = "" ; Write Example data to the ini file $sTxt &= "[ClockSetting]" & @CRLF $sTxt &= "file=" & $sIniPath & @CRLF $sTxt &= "width=600" & @CRLF $sTxt &= "x=-1" & @CRLF $sTxt &= "y=-1" & @CRLF $sTxt &= "sound=C:\Windows\Media\ringout.wav" & @CRLF $sTxt &= "day=1,2,3,4,5" & @CRLF $sTxt &= "active=1" & @CRLF $sTxt &= "time=17:30" & @CRLF FileWrite($sIniPath, $sTxt) EndIf ; Read the INI section labelled 'ClockSetting'. This will return a 2 dimensional array. Local $aArray = IniReadSection($sIniPath, "ClockSetting") Local $mMap[] If Not @error Then For $i = 1 To $aArray[0][0] $mMap[$aArray[$i][0]] = $aArray[$i][1] Next EndIf Return $mMap EndFunc ;==>_GetClockSetting ;--------------------------------------------------------------------------------------- Func _CheckAlarm() If $mAlarm.active <> "1" Then Return Local $iPos = StringInStr($mAlarm.day, @WDAY) If Not @error And $iPos > 0 Then If $mAlarm.time = @HOUR & ":" & @MIN Then ShellExecute($mAlarm.sound) EndIf EndFunc ;==>_CheckAlarm ;--------------------------------------------------------------------------------------- Func _SetAlarm() Local Const $MARGIN = 10 Local $hGUI = GUICreate("Set Alarm", 300, 260, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUICtrlCreateLabel("Select Days:", $MARGIN, $MARGIN, 100, 20) GUICtrlSetFont(-1, 9, 800) Local $a_idDays[7] Local $aDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] Local $iY = $MARGIN + 25 For $i = 0 To UBound($aDays) - 1 $a_idDays[$i] = GUICtrlCreateCheckbox($aDays[$i], 10, $iY, 90, 20) Local $iPos = StringInStr($mAlarm.day, $i + 1) If Not @error And $iPos > 0 Then GUICtrlSetState(-1, $GUI_CHECKED) $iY += (20 + 2) Next GUICtrlCreateLabel("Set Time (HH:MM):", 170, $MARGIN, 150, 20) GUICtrlSetFont(-1, 9, 800) ; Bold Local $idInputTime = GUICtrlCreateInput($mAlarm.time, 180, 35, 80, 20) GUICtrlSetFont(-1, 10) Local $idInfo = GUICtrlCreateLabel("", 100, 65, 190, 100) GUICtrlSetFont(-1, 10) $iY += $MARGIN GUICtrlCreateLabel("Select Sound File:", $MARGIN, $iY, 150, 20) GUICtrlSetFont(-1, 9, 800) ; Bold Local $idInputSoundFile = GUICtrlCreateInput($mAlarm.sound, $MARGIN, $iY + 25, 240, 20) Local $idBtnBrowse = GUICtrlCreateButton("...", 260, $iY + 25, 30, 20) Local $idBtnSetAlarm = GUICtrlCreateButton("Set Alarm", 190, 170, 100, 20 + 5) GUICtrlSetFont(-1, 10, 800) GUISetState(@SW_SHOW) While 1 Local $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idBtnBrowse Local $sSoundFile = FileOpenDialog("Select Alarm Sound", @WorkingDir, "Sound Files (*.mp3;*.wav)|All Files (*.*)") If Not @error Then GUICtrlSetData($idInputSoundFile, $sSoundFile) Case $idBtnSetAlarm Local $sTime , $sSoundPath, $sDays = "", $sInfo = "" GUICtrlSetData($idInfo, "") For $i = 0 To UBound($a_idDays) - 1 If GUICtrlRead($a_idDays[$i]) = $GUI_CHECKED Then $sDays &= $i + 1 & "," Next $sDays = StringTrimRight($sDays, 1) ; remove last "," If $sDays = "" Then $sInfo &= "⚠ Please select at least one day." & @CRLF $sTime = GUICtrlRead($idInputTime) If Not StringRegExp($sTime, "^\d{2}:\d{2}$") Then $sInfo &= "⚠ Please enter time in HH:MM format (e.g., 07:30)." & @CRLF $sSoundPath = GUICtrlRead($idInputSoundFile) If $sSoundPath = "" Then $sInfo &= "⚠ Please select an sound file." GUICtrlSetData($idInfo, $sInfo) If $sInfo <> "" Then ContinueCase ; checks if everything is valid $mAlarm.day = $sDays $mAlarm.time = $sTime $mAlarm.sound = $sSoundPath IniWrite($mAlarm.file, "ClockSetting", "day", $sDays) IniWrite($mAlarm.file, "ClockSetting", "time", $sTime) IniWrite($mAlarm.file, "ClockSetting", "sound", $sSoundPath) ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>_SetAlarm ...but I didn't stop there and ended up with this Release 0.12 ; https://www.autoitscript.com/forum/topic/213036-%F0%9F%95%91-analog-clock/ ;---------------------------------------------------------------------------------------- ; Title...........: Analog_Clock.au3 ; Description.....: Analog clock GUI with alarm functionality. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.12 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Math.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <TrayConstants.au3> #include <Misc.au3> #include <Timers.au3> Opt("TrayMenuMode", 3) ; 0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return ; Global Constants Global Const $AC_SRC_ALPHA = 0x01 Global Const $GDIP_TEXTRENDERINGHINT_CLEARTYPEGRIDFIT = 5 Global Const $GDIP_STRINGFORMAT_ALIGNMENT_CENTER = 1 Global Const $GDIP_STRINGFORMAT_LINEALIGNMENT_CENTER = 1 ; Global Variables Global $hGUIClock Global $hImageBuffer, $hGraphicBuffer Global $hClockImage = 0 Global $hPenSeconds, $hPenMinutes, $hPenHours, $hBrushCenter Global $iClockWidth = 600, $iClockHeight = 600 Global $mClock = _GetClockSetting(StringTrimRight(@ScriptFullPath, 4) & ".ini") _GDIPlus_Startup() ; Try to load a clock background image _GetClockImage($mClock.Image) ; Start the Clock GUI _CreateClock($mClock.Width, $mClock.X, $mClock.Y) Exit ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Try to load the clock background image Func _GetClockImage($sImagePath = Default) ; The Default clock background image If $sImagePath = Default Or $sImagePath = "Default" Then $sImagePath = StringTrimRight(@ScriptFullPath, 4) & ".png" If Not FileExists($sImagePath) Then ConsoleWrite("WARNING: ClockImage not found or could not be loaded initially. fallback to Default" & @CRLF) ; Set $sImagePath to Default $sImagePath = StringTrimRight(@ScriptFullPath, 4) & ".png" EndIf ; If there isn't one, make one. If Not FileExists($sImagePath) Then ConsoleWrite("WARNING: Default Image not found or could not be loaded initially. Generating new image..." & @CRLF) Local $bOk = _CreateAndSaveClockImage($iClockWidth, $sImagePath) If $bOk Then ConsoleWrite("INFO: Default Image generated successfully. Attempting to load it now." & @CRLF) Else ConsoleWrite("ERROR: Failed to generate Default Image Will go to exit." & @CRLF) Exit EndIf EndIf $hClockImage = _GDIPlus_ImageLoadFromFile($sImagePath) ; Check if loaded image is a valid pointer and file has content If IsPtr($hClockImage) And FileGetSize($sImagePath) > 0 Then ConsoleWrite("INFO: Loaded ClockImage." & @CRLF) Else ConsoleWrite("ERROR: Failed to Loaded the ClockImage. Will go to exit." & @CRLF) Exit EndIf EndFunc ;==>_GetClockImage ; Clock GUI - Initialization and Main Loop Func _CreateClock($iWidth, $iX = -1, $iY = -1) ; Tray Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Local $idMove = TrayCreateItem("Move") Local $idAlarmActive = TrayCreateItem("Alarm Enable/Disable") TrayItemSetState($idAlarmActive, ($mClock.Alarm = "1" ? $TRAY_CHECKED : $TRAY_UNCHECKED)) Local $iSettings = TrayCreateMenu("Settings") Local $idSetAlarm = TrayCreateItem("Alarm Setting", $iSettings) Local $idSetColors = TrayCreateItem("Colors Setting", $iSettings) Local $idIniFile = TrayCreateItem("Ini file", $iSettings) Local $idRestart = TrayCreateItem("Restart", $iSettings) TrayCreateItem("") ; separator ----------------------- Local $idClose = TrayCreateItem("Close") TraySetClick($TRAY_CLICK_SECONDARYUP) TraySetIcon("mmcndmgr.dll", -15) TraySetToolTip("Analog Clock") TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Local $hDLL = DllOpen("user32.dll") ; for _IsPressed $iClockWidth = $iWidth $iClockHeight = $iWidth ; The clock GUI $hGUIClock = GUICreate("Analog Clock", $iClockWidth, $iClockHeight, $iX, $iY, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW)) Local $idMouseLab = GUICtrlCreateLabel("", $iWidth / 2 - 5, $iWidth / 2 - 5, 10, 10) GUISetState(@SW_SHOW) $hImageBuffer = _GDIPlus_BitmapCreateFromScan0($iClockWidth, $iClockHeight) $hGraphicBuffer = _GDIPlus_ImageGetGraphicsContext($hImageBuffer) _GDIPlus_GraphicsSetSmoothingMode($hGraphicBuffer, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Colors from inifile RGB to ARGB Local $sColorSeconds = "0xFF" & StringTrimLeft($mClock.ColorSeconds, 2) Local $sColorMinutes = "0xFF" & StringTrimLeft($mClock.ColorMinutes, 2) Local $sColorHours = "0xFF" & StringTrimLeft($mClock.ColorHours, 2) Local $sColorCenter = "0xFF" & StringTrimLeft($mClock.ColorCenter, 2) ; hands Width Local $iWSeconds = ($iWidth * 0.005 < 2 ? 2 : $iWidth * 0.005) Local $iWMinutes = ($iWidth * 0.015 < 4 ? 4 : $iWidth * 0.015) Local $iWHours = ($iWidth * 0.020 < 6 ? 6 : $iWidth * 0.020) ; Initialize pens and brush for drawing hands and center circle $hPenSeconds = _GDIPlus_PenCreate($sColorSeconds, $iWSeconds) ; 0xFFFF0000 $hPenMinutes = _GDIPlus_PenCreate($sColorMinutes, $iWMinutes) ; 0xFF40C880 $hPenHours = _GDIPlus_PenCreate($sColorHours, $iWHours) ; 0xFF0080C0 $hBrushCenter = _GDIPlus_BrushCreateSolid($sColorCenter) ; 0xFF000000 ; SetTimer so it doesn't freeze with the tray menu _Timer_SetTimer($hGUIClock, 250, "_RedrawClock") Local $bRestart, $aMpos, $iCnt = 0, $Tick = -1 ;******************************************** While 1 ; Check Alarm If $Tick <> @MIN Then $Tick = @MIN _CheckAlarm() _ActivityTimeout($mClock.ActivityTimeout) EndIf ; GUI Msg $idMouseLab Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN ; long press Left mouse button in bullet, to move the clock Local $a = GUIGetCursorInfo() If $a[4] = $idMouseLab Then While _IsPressed("01", $hDLL) ; 01 Left mouse button $iCnt += 1 If $iCnt > 60 Then $aMpos = MouseGetPos() WinMove($hGUIClock, '', $aMpos[0] - $iWidth / 2, $aMpos[1] - $iWidth / 2) ToolTip("Move it", $aMpos[0] + 30, $aMpos[1] - 10) EndIf Sleep(10) WEnd If $iCnt > 60 Then ToolTip("") $mClock.X = $aMpos[0] - $iWidth / 2 $mClock.Y = $aMpos[1] - $iWidth / 2 IniWrite($mClock.IniFile, "ClockSetting", "X", $mClock.X) IniWrite($mClock.IniFile, "ClockSetting", "Y", $mClock.Y) EndIf $iCnt = 0 EndIf EndSwitch ; Tray Msg Switch TrayGetMsg() Case $idClose ExitLoop Case $idMove ; move the clock WinActivate($hGUIClock) While 1 $aMpos = MouseGetPos() WinMove($hGUIClock, '', $aMpos[0] - $iWidth / 2, $aMpos[1] - $iWidth / 2) ToolTip("click to drop it", $aMpos[0] + 30, $aMpos[1] - 10) If _IsPressed("01", $hDLL) Then ExitLoop ; 01 Left mouse button Sleep(10) WEnd ToolTip("") $mClock.X = $aMpos[0] - $iWidth / 2 $mClock.Y = $aMpos[1] - $iWidth / 2 IniWrite($mClock.IniFile, "ClockSetting", "X", $mClock.X) IniWrite($mClock.IniFile, "ClockSetting", "Y", $mClock.Y) Case $idAlarmActive ; Alarm Enable/Disable If BitAND(TrayItemGetState($idAlarmActive), $TRAY_CHECKED) Then ; If $TRAY_CHECKED TrayItemSetState($idAlarmActive, $TRAY_UNCHECKED) IniWrite($mClock.IniFile, "ClockSetting", "Alarm", "0") $mClock.Alarm = "0" Else ; If $TRAY_UNCHECKED TrayItemSetState($idAlarmActive, $TRAY_CHECKED) IniWrite($mClock.IniFile, "ClockSetting", "Alarm", "1") $mClock.Alarm = "1" EndIf Case $idSetAlarm ; Alarm Setting _SetAlarm() Case $idSetColors ; Colors Setting _SetColors() Case $idIniFile ; Ini File (open ini file) ShellExecute($mClock.IniFile) Case $idRestart ; Restart the clock $bRestart = True ExitLoop Case $TRAY_EVENT_PRIMARYDOUBLE ; double click activate clock WinActivate($hGUIClock) EndSwitch WEnd ;******************************************** ; Clean up resources _Timer_KillAllTimers($hGUIClock) _GDIPlus_PenDispose($hPenSeconds) _GDIPlus_PenDispose($hPenMinutes) _GDIPlus_PenDispose($hPenHours) _GDIPlus_BrushDispose($hBrushCenter) _GDIPlus_GraphicsDispose($hGraphicBuffer) _GDIPlus_ImageDispose($hImageBuffer) _GDIPlus_ImageDispose($hClockImage) _GDIPlus_Shutdown() DllClose($hDLL) GUIDelete($hGUIClock) If $bRestart Then Local $Cmd = StringRight(@ScriptFullPath, 4) = ".exe" ? '"' & @ScriptFullPath & '"' : '"' & @AutoItExe & '" "' & @ScriptFullPath & '"' Exit Run($Cmd) EndIf EndFunc ;==>_CreateClock ; Helper Function to Draw a Hand Func _DrawHand($hGraphic, $hPen, $iX1, $iY1, $iLength, $fAngleDegrees) Local $fAngleRadians = _Radian($fAngleDegrees) Local $iX2 = $iX1 + ($iLength * Cos($fAngleRadians)) Local $iY2 = $iY1 + ($iLength * Sin($fAngleRadians)) _GDIPlus_GraphicsDrawLine($hGraphic, $iX1, $iY1, $iX2, $iY2, $hPen) EndFunc ;==>_DrawHand ; Redraw Clock Function (CallBack by timer) Func _RedrawClock($hWnd, $iMsg, $iIDTimer, $iTime) #forceref $hWnd, $iMsg, $iIDTimer, $iTime Local $iCurrentHour = @HOUR Local $iCurrentMinute = @MIN Local $iCurrentSecond = @SEC Local $iCenterX = $iClockWidth / 2 Local $iCenterY = $iClockHeight / 2 Local $iClockRadius = $iClockWidth / 2 _GDIPlus_GraphicsClear($hGraphicBuffer, 0x00000000) _GDIPlus_GraphicsDrawImageRect($hGraphicBuffer, $hClockImage, 0, 0, $iClockWidth, $iClockHeight) ; Calculate angles for smooth hand movement Local $iDisplayHour = $iCurrentHour If $iDisplayHour > 12 Then $iDisplayHour -= 12 Local $fAngleHours = ($iDisplayHour * 30) + ($iCurrentMinute * 0.5) - 90 _DrawHand($hGraphicBuffer, $hPenHours, $iCenterX, $iCenterY, $iClockRadius * 0.5, $fAngleHours) Local $fAngleMinutes = ($iCurrentMinute * 6) + ($iCurrentSecond * 0.1) - 90 _DrawHand($hGraphicBuffer, $hPenMinutes, $iCenterX, $iCenterY, $iClockRadius * 0.7, $fAngleMinutes) Local $fAngleSeconds = ($iCurrentSecond * 6) - 90 ; + ($iCurrentMillisecond * 0.006) ; - 90 _DrawHand($hGraphicBuffer, $hPenSeconds, $iCenterX, $iCenterY, $iClockRadius * 0.8, $fAngleSeconds) ; Draw center bullet Local $iBulletRadius = 10 _GDIPlus_GraphicsFillEllipse($hGraphicBuffer, $iCenterX - $iBulletRadius, $iCenterY - $iBulletRadius, $iBulletRadius * 2, $iBulletRadius * 2, $hBrushCenter) ; Create HBITMAP and display Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageBuffer) If IsPtr($hHBitmap) Then _WinAPI_BitmapDisplayTransparentInGUI($hHBitmap, $hWnd) EndFunc ;==>_RedrawClock ; Custom _WinAPI_BitmapDisplayTransparentInGUI Function (by UEZ) Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $bReleaseGDI = True) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) Then Return SetError(1, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) Local Const $hOldBitmap = _WinAPI_SelectObject($hMemDC, $hHBitmap) Local $tBitmapInfo = DllStructCreate($tagBITMAP) _WinAPI_GetObject($hHBitmap, DllStructGetSize($tBitmapInfo), DllStructGetPtr($tBitmapInfo)) $tSize.X = $tBitmapInfo.bmWidth $tSize.Y = $tBitmapInfo.bmHeight $tBlend.Alpha = 0xFF $tBlend.Format = $AC_SRC_ALPHA _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) _WinAPI_SelectObject($hMemDC, $hOldBitmap) _WinAPI_DeleteDC($hMemDC) _WinAPI_ReleaseDC(0, $hScrDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc ;==>_WinAPI_BitmapDisplayTransparentInGUI ; This function draws a clock dial and saves it as a PNG. Func _CreateAndSaveClockImage($iWidth, $sFilePath) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iWidth) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $GDIP_TEXTRENDERINGHINT_CLEARTYPEGRIDFIT) Local $iCenterX = $iWidth / 2 Local $iCenterY = $iWidth / 2 Local $iRadius = $iWidth / 2 ; Clear with transparent background (ARGB: A=00) _GDIPlus_GraphicsClear($hGraphics, 0x00000000) ; Colors from inifile RGB to ARGB Local $sColorOutline = "0xFF" & StringTrimLeft($mClock.ColorOutline, 2) Local $sColorTextHour = "0xFF" & StringTrimLeft($mClock.ColorTextHour, 2) Local $sColorTextMin = "0xFF" & StringTrimLeft($mClock.ColorTextMin, 2) ; Colors and Pens/Brushes Local $hPenOutline = _GDIPlus_PenCreate($sColorOutline, 5) ; 0xFFEEEEEE Local $hPenHourMark = _GDIPlus_PenCreate($sColorOutline, 5) Local $hPenMinuteMark = _GDIPlus_PenCreate($sColorOutline, 2) Local $hBrushTextMin = _GDIPlus_BrushCreateSolid($sColorTextMin) Local $hBrushTextHour = _GDIPlus_BrushCreateSolid($sColorTextHour) ; String Format for drawing and measuring text (centered) Local $hStringFormatCenter = _GDIPlus_StringFormatCreate() ; Check if string format object was successfully created If Not IsPtr($hStringFormatCenter) Or $hStringFormatCenter = 0 Then ConsoleWrite("ERROR: Failed to create GDI+ StringFormat object." & @CRLF) ; Clean up other resources before returning failure _GDIPlus_PenDispose($hPenOutline) _GDIPlus_PenDispose($hPenHourMark) _GDIPlus_PenDispose($hPenMinuteMark) _GDIPlus_BrushDispose($hBrushTextMin) _GDIPlus_BrushDispose($hBrushTextHour) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hBitmap) Return False EndIf _GDIPlus_StringFormatSetAlign($hStringFormatCenter, $GDIP_STRINGFORMAT_ALIGNMENT_CENTER) _GDIPlus_StringFormatSetLineAlign($hStringFormatCenter, $GDIP_STRINGFORMAT_LINEALIGNMENT_CENTER) ; Draw outer circle Local $iOutlinePadding = 5 _GDIPlus_GraphicsDrawEllipse($hGraphics, $iOutlinePadding, $iOutlinePadding, $iWidth - (2 * $iOutlinePadding), $iWidth - (2 * $iOutlinePadding), $hPenOutline) ; Draw hour and minute marks For $i = 0 To 59 Local $fAngleDegrees = ($i * 6) - 90 Local $fAngleRadians = _Radian($fAngleDegrees) Local $iStartX, $iStartY, $iEndX, $iEndY Local $iMarkLength If Mod($i, 5) = 0 Then ; Hour marks (every 5 minutes) $iMarkLength = $iRadius * 0.06 $iStartX = $iCenterX + (($iRadius - ($iRadius * 0.02)) * Cos($fAngleRadians)) $iStartY = $iCenterY + (($iRadius - ($iRadius * 0.02)) * Sin($fAngleRadians)) $iEndX = $iCenterX + (($iRadius - $iMarkLength - ($iRadius * 0.02)) * Cos($fAngleRadians)) $iEndY = $iCenterY + (($iRadius - $iMarkLength - ($iRadius * 0.02)) * Sin($fAngleRadians)) _GDIPlus_GraphicsDrawLine($hGraphics, $iStartX, $iStartY, $iEndX, $iEndY, $hPenHourMark) Else ; Minute marks $iMarkLength = $iRadius * 0.04 $iStartX = $iCenterX + (($iRadius - ($iRadius * 0.02)) * Cos($fAngleRadians)) $iStartY = $iCenterY + (($iRadius - ($iRadius * 0.02)) * Sin($fAngleRadians)) $iEndX = $iCenterX + (($iRadius - $iMarkLength - ($iRadius * 0.02)) * Cos($fAngleRadians)) $iEndY = $iCenterY + (($iRadius - $iMarkLength - ($iRadius * 0.02)) * Sin($fAngleRadians)) _GDIPlus_GraphicsDrawLine($hGraphics, $iStartX, $iStartY, $iEndX, $iEndY, $hPenMinuteMark) EndIf Next ; Draw numbers (Hours and Minutes) Local $iHourTextRadius = $iRadius * 0.66 ; Radius for hour numbers (adjust this to move them closer/further from center) Local $iMinuteTextRadius = $iRadius * 0.86 ; Radius for minute numbers ; Define font families Local $sFontName = "Times New Roman" Local $hFontFamily = _GDIPlus_FontFamilyCreate($sFontName) ; Critical check for font family handle If Not IsPtr($hFontFamily) Or $hFontFamily = 0 Then ConsoleWrite("ERROR: _GDIPlus_FontFamilyCreate returned an invalid handle for '" & $sFontName & "'. @error is: " & @error & @CRLF) ; Clean up current resources before returning failure _GDIPlus_PenDispose($hPenOutline) _GDIPlus_PenDispose($hPenHourMark) _GDIPlus_PenDispose($hPenMinuteMark) _GDIPlus_BrushDispose($hBrushTextMin) _GDIPlus_BrushDispose($hBrushTextHour) _GDIPlus_StringFormatDispose($hStringFormatCenter) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hBitmap) Return False EndIf For $i = 1 To 12 ; Hour Numbers (1-12) Local $sHourDigit = $i Local $fHourAngleDegrees = ($i * 30) - 90 Local $fHourAngleRadians = _Radian($fHourAngleDegrees) Local $iHourFontSize = 50 Local $hHourFont = _GDIPlus_FontCreate($hFontFamily, $iHourFontSize, 1) ; 1 = Bold typeface ; Check for font handle If Not IsPtr($hHourFont) Or $hHourFont = 0 Then ConsoleWrite("ERROR: _GDIPlus_FontCreate failed for hour font. Skipping text drawing." & @CRLF) ContinueLoop ; Skip drawing this text if font creation failed EndIf ; Calculate the approximate position for the text bounding box (large enough to contain text) Local $fApproxTextSize = $iHourFontSize * 1.5 Local $tHourLayoutRect = _GDIPlus_RectFCreate($iCenterX - $fApproxTextSize, $iCenterY - $fApproxTextSize, $fApproxTextSize * 2, $fApproxTextSize * 2) ; Measure text to get its exact dimensions Local $aHourMeasure = _GDIPlus_GraphicsMeasureString($hGraphics, $sHourDigit, $hHourFont, $tHourLayoutRect, $hStringFormatCenter) Local $fHourTextWidth = 0, $fHourTextHeight = 0 If Not @error And IsArray($aHourMeasure) And DllStructGetData($aHourMeasure[0], "Width") > 0 And DllStructGetData($aHourMeasure[0], "Height") > 0 Then $fHourTextWidth = DllStructGetData($aHourMeasure[0], "Width") $fHourTextHeight = DllStructGetData($aHourMeasure[0], "Height") Else ; Fallback: Simple estimation if measurement fails $fHourTextWidth = $iHourFontSize * 0.6 * StringLen($sHourDigit) $fHourTextHeight = $iHourFontSize * 1.0 ConsoleWrite("WARNING: Failed to measure hour text '" & $sHourDigit & "'. Fallback: Using estimation." & @CRLF) EndIf ; Calculate the FINAL position for the text, taking into account text dimensions and desired radius Local $iHourTextX = $iCenterX + ($iHourTextRadius * Cos($fHourAngleRadians)) - ($fHourTextWidth / 2) Local $iHourTextY = $iCenterY + ($iHourTextRadius * Sin($fHourAngleRadians)) - ($fHourTextHeight / 2) ; Create a layout rectangle specific for drawing the text at the calculated position Local $tDrawHourLayout = _GDIPlus_RectFCreate($iHourTextX, $iHourTextY, $fHourTextWidth, $fHourTextHeight) ; Draw the string using _GDIPlus_GraphicsDrawStringEx _GDIPlus_GraphicsDrawStringEx($hGraphics, $sHourDigit, $hHourFont, $tDrawHourLayout, $hStringFormatCenter, $hBrushTextHour) _GDIPlus_FontDispose($hHourFont) ; Minute Numbers (5, 10, ..., 60) Local $sMinuteDigit = $i * 5 If $sMinuteDigit = 60 Then $sMinuteDigit = "00" Local $fMinuteAngleDegrees = ($i * 30) - 90 Local $fMinuteAngleRadians = _Radian($fMinuteAngleDegrees) Local $iMinuteFontSize = 20 Local $hMinuteFont = _GDIPlus_FontCreate($hFontFamily, $iMinuteFontSize, 1) ; 1 = Bold typeface ; Check for font handle If Not IsPtr($hMinuteFont) Or $hMinuteFont = 0 Then ConsoleWrite("ERROR: _GDIPlus_FontCreate failed for minute font. Skipping text drawing." & @CRLF) ContinueLoop ; Skip drawing this text if font creation failed EndIf Local $fApproxMinuteTextSize = $iMinuteFontSize * 1.5 Local $tMinuteLayoutRect = _GDIPlus_RectFCreate($iCenterX - $fApproxMinuteTextSize, $iCenterY - $fApproxMinuteTextSize, $fApproxMinuteTextSize * 2, $fApproxMinuteTextSize * 2) ; Measure text Local $aMinuteMeasure = _GDIPlus_GraphicsMeasureString($hGraphics, $sMinuteDigit, $hMinuteFont, $tMinuteLayoutRect, $hStringFormatCenter) Local $fMinuteTextWidth = 0, $fMinuteTextHeight = 0 If Not @error And IsArray($aMinuteMeasure) And DllStructGetData($aMinuteMeasure[0], "Width") > 0 And DllStructGetData($aMinuteMeasure[0], "Height") > 0 Then $fMinuteTextWidth = DllStructGetData($aMinuteMeasure[0], "Width") $fMinuteTextHeight = DllStructGetData($aMinuteMeasure[0], "Height") Else ; Fallback: Simple estimation if measurement fails $fMinuteTextWidth = $iMinuteFontSize * 0.6 * StringLen($sMinuteDigit) $fMinuteTextHeight = $iMinuteFontSize * 1.0 ConsoleWrite("WARNING: Failed to measure minute text '" & $sMinuteDigit & "'. Fallback: Using estimation." & @CRLF) EndIf Local $iMinuteTextX = $iCenterX + ($iMinuteTextRadius * Cos($fMinuteAngleRadians)) - ($fMinuteTextWidth / 2) Local $iMinuteTextY = $iCenterY + ($iMinuteTextRadius * Sin($fMinuteAngleRadians)) - ($fMinuteTextHeight / 2) Local $tDrawMinuteLayout = _GDIPlus_RectFCreate($iMinuteTextX, $iMinuteTextY, $fMinuteTextWidth, $fMinuteTextHeight) ; Draw the string using _GDIPlus_GraphicsDrawStringEx _GDIPlus_GraphicsDrawStringEx($hGraphics, $sMinuteDigit, $hMinuteFont, $tDrawMinuteLayout, $hStringFormatCenter, $hBrushTextMin) _GDIPlus_FontDispose($hMinuteFont) Next _GDIPlus_FontFamilyDispose($hFontFamily) ; Dispose font family after the loop ; Save the bitmap to a PNG file Local $bSuccess = _GDIPlus_ImageSaveToFile($hBitmap, $sFilePath) ConsoleWrite("DEBUG: _GDIPlus_ImageSaveToFile $bSuccess=" & $bSuccess & ", @error=" & @error & @CRLF) ; Add check for file exist and size after saving If FileExists($sFilePath) And FileGetSize($sFilePath) > 0 Then Sleep(200) ; Give some time for file system to release the file Else ConsoleWrite("ERROR: File save verification failed for '" & $sFilePath & "'. Success: " & $bSuccess & ", Exists: " & FileExists($sFilePath) & ", Size: " & FileGetSize($sFilePath) & @CRLF) $bSuccess = False EndIf ; Clean up resources _GDIPlus_PenDispose($hPenOutline) _GDIPlus_PenDispose($hPenHourMark) _GDIPlus_PenDispose($hPenMinuteMark) _GDIPlus_BrushDispose($hBrushTextHour) _GDIPlus_BrushDispose($hBrushTextMin) _GDIPlus_StringFormatDispose($hStringFormatCenter) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hBitmap) Return $bSuccess EndFunc ;==>_CreateAndSaveClockImage ; Make, and read ini to map Func _GetClockSetting($sIniPath) If Not FileExists($sIniPath) Then ; make one Local $sTxt = "" ; Write Example data to the ini file $sTxt &= "[ClockSetting]" & @CRLF $sTxt &= "IniFile=" & $sIniPath & @CRLF $sTxt &= "Image=Default" & @CRLF $sTxt &= "Width=600" & @CRLF $sTxt &= "X=-1" & @CRLF $sTxt &= "Y=-1" & @CRLF $sTxt &= "ColorSeconds=0xFF0000" & @CRLF $sTxt &= "ColorMinutes=0x40C880" & @CRLF $sTxt &= "ColorHours=0x0080C0" & @CRLF $sTxt &= "ColorCenter=0x000000" & @CRLF $sTxt &= "ColorTextHour=0xFFFFFF" & @CRLF $sTxt &= "ColorTextMin=0xFFFFFF" & @CRLF $sTxt &= "ColorOutline=0xFFFFFF" & @CRLF $sTxt &= "Alarm=1" & @CRLF $sTxt &= "AlarmSound=C:\Windows\Media\ringout.wav" & @CRLF $sTxt &= "AlarmDays=2,3,4,5,6" & @CRLF $sTxt &= "AlarmTime=17:30" & @CRLF $sTxt &= "ActivityTimeout=3" & @CRLF FileWrite($sIniPath, $sTxt) EndIf ; Read the INI section labelled 'ClockSetting'. This will return a 2 dimensional array. Local $aArray = IniReadSection($sIniPath, "ClockSetting") Local $mMap[] If Not @error Then For $i = 1 To $aArray[0][0] $mMap[$aArray[$i][0]] = $aArray[$i][1] Next EndIf ; Default colors If $mMap.ColorSeconds = "" Then $mMap.ColorSeconds = "0xFF0000" If $mMap.ColorMinutes = "" Then $mMap.ColorMinutes = "0x40C880" If $mMap.ColorHours = "" Then $mMap.ColorHours = "0x0080C0" If $mMap.ColorCenter = "" Then $mMap.ColorCenter = "0x000000" If $mMap.ColorTextHour = "" Then $mMap.ColorTextHour = "0xFFFFFF" If $mMap.ColorTextMin = "" Then $mMap.ColorTextMin = "0xFFFFFF" If $mMap.ColorOutline = "" Then $mMap.ColorOutline = "0xFFFFFF" Return $mMap EndFunc ;==>_GetClockSetting ; Check Alarm time Func _CheckAlarm() If $mClock.Alarm <> "1" Then Return Local $iPos = StringInStr($mClock.AlarmDays, @WDAY) If Not @error And $iPos > 0 Then If $mClock.AlarmTime = @HOUR & ":" & @MIN Then ShellExecute($mClock.AlarmSound) EndIf EndFunc ;==>_CheckAlarm ; Set Alarm GUI Func _SetAlarm() Local Const $MARGIN = 10 Local $hGUIAlarm = GUICreate("Set Alarm", 300, 260, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUICtrlCreateLabel("Select Days:", $MARGIN, $MARGIN, 100, 20) GUICtrlSetFont(-1, 9, 800) Local $a_idDays[7] Local $aDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] Local $iY = $MARGIN + 25 For $i = 0 To UBound($aDays) - 1 $a_idDays[$i] = GUICtrlCreateCheckbox($aDays[$i], 10, $iY, 90, 20) Local $iPos = StringInStr($mClock.AlarmDays, $i + 1) If Not @error And $iPos > 0 Then GUICtrlSetState(-1, $GUI_CHECKED) $iY += (20 + 2) Next GUICtrlCreateLabel("Set Time (HH:MM):", 170, $MARGIN, 150, 20) GUICtrlSetFont(-1, 9, 800) ; Bold Local $idInputTime = GUICtrlCreateInput($mClock.AlarmTime, 180, 35, 80, 20) GUICtrlSetFont(-1, 10) Local $idInfo = GUICtrlCreateLabel("", 100, 65, 190, 100) GUICtrlSetFont(-1, 10) $iY += $MARGIN GUICtrlCreateLabel("Select Sound File:", $MARGIN, $iY, 150, 20) GUICtrlSetFont(-1, 9, 800) ; Bold Local $idInputSoundFile = GUICtrlCreateInput($mClock.AlarmSound, $MARGIN, $iY + 25, 240, 20) Local $idBtnBrowse = GUICtrlCreateButton("...", 260, $iY + 25, 30, 20) Local $idBtnSetAlarm = GUICtrlCreateButton("Set Alarm", 190, 170, 100, 20 + 5) GUICtrlSetFont(-1, 10, 800) GUISetState(@SW_SHOW) While 1 Local $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idBtnBrowse Local $sSoundFile = FileOpenDialog("Select Alarm Sound", @WorkingDir, "Sound Files (*.mp3;*.wav)|All Files (*.*)") If Not @error Then GUICtrlSetData($idInputSoundFile, $sSoundFile) Case $idBtnSetAlarm Local $sTime, $sSoundPath, $sDays = "", $sInfo = "" GUICtrlSetData($idInfo, "") For $i = 0 To UBound($a_idDays) - 1 If GUICtrlRead($a_idDays[$i]) = $GUI_CHECKED Then $sDays &= $i + 1 & "," Next $sDays = StringTrimRight($sDays, 1) ; remove last "," If $sDays = "" Then $sInfo &= "⚠ Please select at least one day." & @CRLF $sTime = GUICtrlRead($idInputTime) If Not StringRegExp($sTime, "^\d{2}:\d{2}$") Then $sInfo &= "⚠ Please enter time in HH:MM format (e.g., 07:30)." & @CRLF $sSoundPath = "" & GUICtrlRead($idInputSoundFile) If $sSoundPath = "" Then $sInfo &= "⚠ Please select an sound file." GUICtrlSetData($idInfo, $sInfo) If $sInfo <> "" Then ContinueCase ; checks if everything is valid $mClock.AlarmDays = $sDays $mClock.AlarmTime = $sTime $mClock.AlarmSound = $sSoundPath IniWrite($mClock.IniFile, "ClockSetting", "AlarmDays", $sDays) IniWrite($mClock.IniFile, "ClockSetting", "AlarmTime", $sTime) IniWrite($mClock.IniFile, "ClockSetting", "AlarmSound", $sSoundPath) ExitLoop EndSwitch WEnd GUIDelete($hGUIAlarm) EndFunc ;==>_SetAlarm ; Set Colors GUI Func _SetColors() Local $hGUIColors = GUICreate("Set Colors", 180, 250, -1, -1, -1, $WS_EX_TOOLWINDOW) GUISetFont(10) GUICtrlCreateLabel("Seconds hand", 10, 10, 101, 17, 0x0002) GUICtrlCreateLabel("Minutes hand", 10, 40, 101, 17, 0x0002) GUICtrlCreateLabel("Hours hand", 10, 70, 101, 17, 0x0002) GUICtrlCreateLabel("Center Pin", 10, 100, 101, 17, 0x0002) GUICtrlCreateLabel("Hours Didits", 10, 130, 101, 17, 0x0002) GUICtrlCreateLabel("Minutes Didits", 10, 160, 101, 17, 0x0002) GUICtrlCreateLabel("Image Outline", 10, 190, 101, 17, 0x0002) Local $aNames[8] = [7, "ColorSeconds", "ColorMinutes", "ColorHours", "ColorCenter", "ColorTextHour", "ColorTextMin", "ColorOutline"] Local $iY = 5 Local $aColors[8][3] $aColors[0][0] = 7 For $i = 1 To $aColors[0][0] $aColors[$i][0] = GUICtrlCreateButton("", 120, $iY, 50, 25, 0x8000) $aColors[$i][1] = $mClock[$aNames[$i]] GUICtrlSetBkColor(-1, $aColors[$i][1]) If $i < 5 Then GUICtrlSetTip(-1, "This will be in effect after restart the clock") If $i > 4 Then GUICtrlSetTip(-1, "This will be in effect after deleting the existing clock image") $iY += 30 Next Local $idSetColors = GUICtrlCreateButton("Set Colors", 70, $iY, 100, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) Local $nMsg, $iChooseColor While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $aColors[1][0] To $aColors[7][0] ;ConsoleWrite("$nMsg=" & $nMsg & @CRLF) Local $id = $nMsg - 10 $iChooseColor = _ChooseColor(2, $aColors[$id][1], 2, $hGUIColors) If $iChooseColor <> -1 Then $aColors[$id][1] = $iChooseColor GUICtrlSetBkColor($aColors[$id][0], $aColors[$id][1]) EndIf Case $idSetColors For $i = 1 To $aColors[0][0] $mClock[$aNames[$i]] = $aColors[$i][1] IniWrite($mClock.IniFile, "ClockSetting", $aNames[$i], $aColors[$i][1]) Next ExitLoop EndSwitch WEnd GUIDelete($hGUIColors) EndFunc ;==>_SetColors Func _ActivityTimeout($iTimeout = 3) Local Static $iMinute, $iMouseX Local $aMpos = MouseGetPos() If $iMouseX <> $aMpos[0] Then $iMouseX = $aMpos[0] $iMinute = 0 Return EndIf $iMinute +=1 If $iMinute = $iTimeout Then $iMinute = 0 WinActivate($hGUIClock) ConsoleWrite("INFO: Activity Timeout triggered." & @CRLF) EndIf EndFunc Extra background image Please, every comment is appreciated! leave your comments and experiences here! Thank you very much5 points
-
Move window behind desktop icons
UEZ and 4 others reacted to argumentum for a topic
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate My take on the problem is creating "WorkerW". Finding it with _WinAPI_EnumWindows() works best. Reading this github.com/rocksdanister/lively/issues/2074 ( and the projects ) look interesting.5 points -
Hey, got it working on Win10. Never expected it. Found some code about forcing the creation of a WorkerW handle. Let's see if it does the job for your too. #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) Example() Func Example() Local $hProgman = WinGetHandle("[CLASS:Progman]") _SendMessage($hProgman, 0x052c) ; <<<<<< force the creation of a WorkerW handle under Progman Local $aList = WinList(), $hWorkerW For $i = 1 To $aList[0][0] If _WinAPI_GetParent($aList[$i][1]) = $hProgman And _WinAPI_GetClassName($aList[$i][1]) = "WorkerW" Then $hWorkerW = $aList[$i][1] ExitLoop EndIf Next ConsoleWrite("WorkerW " & $hWorkerW & @CRLF) Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While Sleep(100) WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate5 points
-
Hour AM/PM ( yes, one more of these )
Danyfirex and 3 others reacted to argumentum for a topic
; #FUNCTION# ==================================================================================================================== ; Name...........: HourAmPm ; Description....: Converts a time in 24-hour format to AM/PM format. ; Syntax.........: HourAmPm( $sDateTime [, $sAmPm = "AM|PM" [, $iTrimRight = 0]] ) ; Parameters.....: $sDateTime - The time (with date or not) string with "HH:" in it. ; $sAmPm - [optional] The AM/PM representation (default is "AM|PM"). ; $iTrimRight - [optional] The number of characters to trim from the right of the result (default is 0). ; $iNoDate - [optional] Whether to omit the date from the output. Defaults to False. ; Return values .: Success: Returns the formatted date and time in AM/PM format. ; Failure: None. ; Author ........: argumentum ; Modified ......: ; Remarks .......: This function takes a 24-hour time string, converts it to AM or PM format, and returns the result with optional trimming. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=213061 ; Example .......: MsgBox(64, "Converted Time", HourAmPm("12/31/1999 18:59:59")) ; =============================================================================================================================== Func HourAmPm($sDateTime, $sAmPm = Default, $iTrimRight = Default, $iNoDate = Default) Local $aAmPm = StringSplit((StringInStr($sAmPm, "|") ? $sAmPm : "AM|PM"), "|"), $sFormat = $aAmPm[2] Local $iHourPos = StringInStr($sDateTime, ":"), $sHour = StringMid($sDateTime, $iHourPos - 2, 2) Local $sDate = StringLeft($sDateTime, $iHourPos - 3), $sTime = StringTrimLeft($sDateTime, $iHourPos - 1) If $sHour < 12 Then $sFormat = $aAmPm[1] ; https://www.autoitscript.com/forum/index.php?showtopic=213061 $sHour = Mod($sHour, 12) If Not $sHour Then $sHour = 12 Return StringTrimRight((Int($iNoDate) ? "" : $sDate) & StringRight('0' & $sHour, 2) & $sTime, Int($iTrimRight)) & " " & $sFormat EndFunc ;==>HourAmPm ...am always looking for these ( because am disorganized ) and when I find them they are more than needed so, I decided to simplify it and flexibly-cate** it. All that's needed is the hour, the rest of the date-time string should be anything as long as there is a "HH:" in it. ; Examples: ConsoleWrite('- ' & HourAmPm("18:59") & @CRLF) ; - 06:59 PM ConsoleWrite('- ' & HourAmPm("18:59:59.999") & @CRLF) ; - 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999") & @CRLF) ; - 1999/12/31 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59", Default, 3) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("12/31/1999 18:59", "a|p") & @CRLF) ; - 12/31/1999 06:59 p ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7, True) & @CRLF) ; - 06:59 PM Don't remember seeing this approach anywhere so I decided to share it **flexibly-cate [verb] To make it flexible4 points -
Helper App: ; ================================================================================================= ; Title .........: AutoIt Embedded File Generator ; Author(s) .....: Dao Van Trong - TRONG.PRO ; Version .......: 2.5 (Fixed syntax and delimiter logic in generated code) ; Description ...: A professional tool to convert binary files into self-contained AutoIt hex functions. ; Features architecture detection, GUI and CLI modes, and robust code generation. ; ================================================================================================= #Region ; *** INCLUDES *** #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Clipboard.au3> #include <File.au3> #include <Array.au3> #include <ListViewConstants.au3> #EndRegion ; *** INCLUDES *** #Region ; *** GLOBAL VARIABLES *** ; Global variables for GUI controls Global $g_hGUI, $g_hListView, $g_hEditOutput, $g_hInputChunkSize Global $g_hBtnAddFiles, $g_hBtnRemoveSelected, $g_hBtnClearAll, $g_hCheckAddHelpers, $g_hBtnGenerate, $g_hBtnPreview, $g_hBtnCopy, $g_hBtnSaveAll, $g_hBtnSaveSeparate, $g_hBtnExit ; Global 2D array to store file information. ; Index [x][0]: Full Path ; Index [x][1]: File Name ; Index [x][2]: Formatted File Size ; Index [x][3]: Architecture ; Index [x][4]: Generated Function Name Global $g_aSelectedFiles[0][5] #EndRegion ; *** GLOBAL VARIABLES *** #Region ; *** SCRIPT ENTRY POINT *** ; Check if command-line arguments were provided to determine execution mode. If $CmdLine[0] > 0 Then _RunCommandLineMode() Else _RunGuiMode() EndIf #EndRegion ; *** SCRIPT ENTRY POINT *** #Region ; *** GUI MODE FUNCTIONS *** ; ------------------------------------------------------------------------------------------------- ; Function: _RunGuiMode() ; Purpose: Creates and manages the main Graphical User Interface (GUI). ; ------------------------------------------------------------------------------------------------- Func _RunGuiMode() $g_hGUI = GUICreate("AutoIt Embedded File Generator by Dao Van Trong - TRONG.PRO", 800, 650) GUISetBkColor(0xF0F0F0) _CreateGUI_Controls() GUISetState(@SW_SHOW, $g_hGUI) Local $nMsg While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $g_hBtnExit ExitLoop Case $g_hBtnAddFiles _GUI_HandleAddFiles() Case $g_hBtnRemoveSelected _GUI_HandleRemoveSelected() Case $g_hBtnClearAll _GUI_HandleClearAll() Case $g_hBtnGenerate _GUI_HandleGenerateAll() Case $g_hBtnPreview _GUI_HandlePreviewSingle() Case $g_hBtnCopy _GUI_HandleCopyToClipboard() Case $g_hBtnSaveAll _GUI_HandleSaveAll() Case $g_hBtnSaveSeparate _GUI_HandleSaveSeparate() EndSwitch WEnd GUIDelete($g_hGUI) EndFunc ;==>_RunGuiMode ; ------------------------------------------------------------------------------------------------- ; Function: _CreateGUI_Controls() ; Purpose: Creates all controls for the main GUI window. ; ------------------------------------------------------------------------------------------------- Func _CreateGUI_Controls() GUICtrlCreateLabel("1. File Selection:", 10, 15, 150, 20) GUICtrlSetFont(-1, 9, 600) $g_hBtnAddFiles = GUICtrlCreateButton("Add Files...", 10, 35, 100, 25) $g_hBtnRemoveSelected = GUICtrlCreateButton("Remove Selected", 120, 35, 120, 25) $g_hBtnClearAll = GUICtrlCreateButton("Clear All", 250, 35, 80, 25) $g_hListView = GUICtrlCreateListView("File Name|Size|Architecture|Function Name", 10, 70, 780, 150) GUICtrlSendMsg($g_hListView, $LVM_SETCOLUMNWIDTH, 0, 250) GUICtrlSendMsg($g_hListView, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSendMsg($g_hListView, $LVM_SETCOLUMNWIDTH, 2, 100) GUICtrlSendMsg($g_hListView, $LVM_SETCOLUMNWIDTH, 3, 320) GUICtrlCreateLabel("2. Generation Options:", 10, 235, 150, 20) GUICtrlSetFont(-1, 9, 600) GUICtrlCreateLabel("Line Length (chars):", 20, 260, 120, 20) $g_hInputChunkSize = GUICtrlCreateInput("4000", 150, 257, 100, 22) $g_hCheckAddHelpers = GUICtrlCreateCheckbox("Include helper functions", 270, 257, 150, 22) GUICtrlSetState($g_hCheckAddHelpers, $GUI_CHECKED) $g_hBtnGenerate = GUICtrlCreateButton("3. Generate All Functions", 10, 290, 200, 35) GUICtrlSetFont(-1, 10, 700) GUICtrlSetBkColor($g_hBtnGenerate, 0x90EE90) $g_hBtnPreview = GUICtrlCreateButton("Preview Single", 220, 290, 100, 35) GUICtrlCreateLabel("Generated Code:", 10, 340, 150, 20) GUICtrlSetFont(-1, 9, 600) $g_hEditOutput = GUICtrlCreateEdit("", 10, 360, 780, 220, $WS_VSCROLL + $WS_HSCROLL) GUICtrlSetFont(-1, 9, 400, 0, "Consolas") $g_hBtnCopy = GUICtrlCreateButton("Copy to Clipboard", 10, 590, 130, 30) $g_hBtnSaveAll = GUICtrlCreateButton("Save All to File", 150, 590, 130, 30) $g_hBtnSaveSeparate = GUICtrlCreateButton("Save Separate Files", 290, 590, 130, 30) $g_hBtnExit = GUICtrlCreateButton("Exit", 660, 590, 130, 30) GUICtrlSetBkColor($g_hBtnExit, 0xFFB6C1) EndFunc ;==>_CreateGUI_Controls ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleAddFiles() ; Purpose: Opens a file dialog and adds selected files to the list. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleAddFiles() Local $sFiles = FileOpenDialog("Select Files", @ScriptDir, "All Files (*.*)", 4) If @error Then Return Local $aNewFiles = StringSplit($sFiles, "|") If $aNewFiles[0] = 1 Then _AddFileToList($aNewFiles[1]) Else Local $sBasePath = $aNewFiles[1] For $i = 2 To $aNewFiles[0] _AddFileToList($sBasePath & "\" & $aNewFiles[$i]) Next EndIf EndFunc ;==>_GUI_HandleAddFiles ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleRemoveSelected() ; Purpose: Removes the selected file from the list. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleRemoveSelected() Local $iIndex = GUICtrlSendMsg($g_hListView, $LVM_GETNEXTITEM, -1, $LVNI_SELECTED) If $iIndex = -1 Then Return _ArrayDelete($g_aSelectedFiles, $iIndex) GUICtrlSendMsg($g_hListView, $LVM_DELETEITEM, $iIndex, 0) EndFunc ;==>_GUI_HandleRemoveSelected ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleClearAll() ; Purpose: Clears all files from the list and resets the UI. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleClearAll() ReDim $g_aSelectedFiles[0][5] GUICtrlSendMsg($g_hListView, $LVM_DELETEALLITEMS, 0, 0) GUICtrlSetData($g_hEditOutput, "") EndFunc ;==>_GUI_HandleClearAll ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleGenerateAll() ; Purpose: Generates the complete code for all files in the list. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleGenerateAll() If UBound($g_aSelectedFiles) = 0 Then Return MsgBox(48, "Warning", "Please add at least one file first.") GUICtrlSetData($g_hEditOutput, "Generating code, please wait...") Sleep(10) Local $bAddHelpers = (GUICtrlRead($g_hCheckAddHelpers) = $GUI_CHECKED) Local $iChunkSize = _ValidateChunkSize(GUICtrlRead($g_hInputChunkSize)) Local $sCode = _GenerateCodeBundle($g_aSelectedFiles, $bAddHelpers, $iChunkSize) GUICtrlSetData($g_hEditOutput, $sCode) EndFunc ;==>_GUI_HandleGenerateAll ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandlePreviewSingle() ; Purpose: Generates code for only the selected file. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandlePreviewSingle() Local $iIndex = GUICtrlSendMsg($g_hListView, $LVM_GETNEXTITEM, -1, $LVNI_SELECTED) If $iIndex = -1 Then Return MsgBox(48, "Warning", "Please select a file from the list first.") GUICtrlSetData($g_hEditOutput, "Generating preview...") Sleep(10) Local $iChunkSize = _ValidateChunkSize(GUICtrlRead($g_hInputChunkSize)) Local $sOutput = "; Preview for: " & $g_aSelectedFiles[$iIndex][1] & @CRLF $sOutput &= "; Architecture: " & $g_aSelectedFiles[$iIndex][3] & @CRLF & @CRLF $sOutput &= _GenerateHexFunction($g_aSelectedFiles[$iIndex][0], $g_aSelectedFiles[$iIndex][4], $g_aSelectedFiles[$iIndex][1], $g_aSelectedFiles[$iIndex][3], "$sHexData", $iChunkSize) GUICtrlSetData($g_hEditOutput, $sOutput) EndFunc ;==>_GUI_HandlePreviewSingle ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleCopyToClipboard() ; Purpose: Copies the output text to the clipboard. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleCopyToClipboard() Local $sCode = GUICtrlRead($g_hEditOutput) If StringStripWS($sCode, 8) = "" Then Return MsgBox(48, "Warning", "No code to copy. Please generate code first.") _ClipBoard_SetData($sCode) ToolTip("Code copied to clipboard!", @DesktopWidth / 2, @DesktopHeight / 2, "Success", 1, 1) Sleep(1500) ToolTip("") EndFunc ;==>_GUI_HandleCopyToClipboard ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleSaveAll() ; Purpose: Saves the generated code for all files into a single .au3 file. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleSaveAll() Local $sCode = GUICtrlRead($g_hEditOutput) If StringStripWS($sCode, 8) = "" Then Return MsgBox(48, "Warning", "No code to save. Please generate code first.") Local $sSaveFile = FileSaveDialog("Save Combined Code", @ScriptDir, "AutoIt Scripts (*.au3)", 16, "All_Embedded.au3") If @error Then Return If Not _SaveStringToFile($sSaveFile, $sCode) Then MsgBox(16, "Error", "Could not create file: " & $sSaveFile) Else MsgBox(64, "Success", "All functions saved to: " & @CRLF & $sSaveFile) EndIf EndFunc ;==>_GUI_HandleSaveAll ; ------------------------------------------------------------------------------------------------- ; Function: _GUI_HandleSaveSeparate() ; Purpose: Saves the generated code for each file into its own separate .au3 file. ; ------------------------------------------------------------------------------------------------- Func _GUI_HandleSaveSeparate() If UBound($g_aSelectedFiles) = 0 Then Return MsgBox(48, "Warning", "No files to process.") Local $sSaveDir = FileSelectFolder("Select folder to save separate files", @ScriptDir) If @error Then Return Local $iChunkSize = _ValidateChunkSize(GUICtrlRead($g_hInputChunkSize)) Local $bAddHelpers = (GUICtrlRead($g_hCheckAddHelpers) = $GUI_CHECKED) Local $iSaved = 0 For $i = 0 To UBound($g_aSelectedFiles) - 1 Local $sFilePath = $g_aSelectedFiles[$i][0] Local $sFileName = $g_aSelectedFiles[$i][1] Local $sArch = $g_aSelectedFiles[$i][3] Local $sFuncName = $g_aSelectedFiles[$i][4] Local $sDrive, $sDir, $sNameOnly, $sExt _PathSplit($sFilePath, $sDrive, $sDir, $sNameOnly, $sExt) Local $sSaveFile = $sSaveDir & "\" & $sNameOnly & "_Embedded.au3" Local $sCode = "; Generated from: " & $sFileName & @CRLF $sCode &= "; Architecture: " & $sArch & @CRLF & @CRLF $sCode &= _GenerateHexFunction($sFilePath, $sFuncName, $sFileName, $sArch, "$sHexData", $iChunkSize) If $bAddHelpers Then $sCode &= _GenerateHelperFunction($sFuncName, $sFileName) EndIf If _SaveStringToFile($sSaveFile, $sCode) Then $iSaved += 1 Next MsgBox(64, "Success", "Saved " & $iSaved & " of " & UBound($g_aSelectedFiles) & " files to:" & @CRLF & $sSaveDir) EndFunc ;==>_GUI_HandleSaveSeparate #EndRegion ; *** GUI MODE FUNCTIONS *** #Region ; *** COMMAND-LINE MODE FUNCTIONS *** ; ------------------------------------------------------------------------------------------------- ; Function: _RunCommandLineMode() ; Purpose: Handles the script's execution when run from the command line. ; ------------------------------------------------------------------------------------------------- Func _RunCommandLineMode() Local $aFilePaths[0] For $i = 1 To $CmdLine[0] If FileExists($CmdLine[$i]) Then _ArrayAdd($aFilePaths, $CmdLine[$i]) Else ConsoleWrite("! Warning: File not found - " & $CmdLine[$i] & @CRLF) EndIf Next If UBound($aFilePaths) = 0 Then ConsoleWrite("! Error: No valid files provided." & @CRLF & " Usage: " & @ScriptName & " <file1> [file2] ..." & @CRLF) Exit 1 EndIf Local $aFilesData[UBound($aFilePaths)][5] For $i = 0 To UBound($aFilePaths) - 1 _PopulateFileInfo($aFilesData, $i, $aFilePaths[$i]) Next ConsoleWrite("+ Generating code for " & UBound($aFilesData) & " file(s)..." & @CRLF) Local $sCode = _GenerateCodeBundle($aFilesData, True, 4000) Local $sOutputFile If UBound($aFilesData) = 1 Then Local $sDrive, $sDir, $sFileName, $sExtension _PathSplit($aFilePaths[0], $sDrive, $sDir, $sFileName, $sExtension) $sOutputFile = $sDrive & $sDir & $sFileName & "_Embedded.au3" Else $sOutputFile = @ScriptDir & "\All_Embedded.au3" EndIf If _SaveStringToFile($sOutputFile, $sCode) Then ConsoleWrite("+ Success: Output saved to - " & $sOutputFile & @CRLF) Else ConsoleWrite("! Error: Could not create output file - " & $sOutputFile & @CRLF) Exit 1 EndIf EndFunc ;==>_RunCommandLineMode #EndRegion ; *** COMMAND-LINE MODE FUNCTIONS *** #Region ; *** FILE AND DATA HANDLING *** ; ------------------------------------------------------------------------------------------------- ; Function: _AddFileToList($sFilePath) ; Purpose: Adds a file's information to the global array and updates the GUI list. ; ------------------------------------------------------------------------------------------------- Func _AddFileToList($sFilePath) If Not FileExists($sFilePath) Then Return For $i = 0 To UBound($g_aSelectedFiles) - 1 If $g_aSelectedFiles[$i][0] = $sFilePath Then Return Next Local $iUBound = UBound($g_aSelectedFiles) ReDim $g_aSelectedFiles[$iUBound + 1][5] _PopulateFileInfo($g_aSelectedFiles, $iUBound, $sFilePath) Local $sListViewItem = $g_aSelectedFiles[$iUBound][1] & "|" & $g_aSelectedFiles[$iUBound][2] & "|" & $g_aSelectedFiles[$iUBound][3] & "|" & $g_aSelectedFiles[$iUBound][4] GUICtrlCreateListViewItem($sListViewItem, $g_hListView) EndFunc ;==>_AddFileToList ; ------------------------------------------------------------------------------------------------- ; Function: _PopulateFileInfo(ByRef $aArray, $iIndex, $sFilePath) ; Purpose: Gathers file info and populates a row in the provided 2D array. ; ------------------------------------------------------------------------------------------------- Func _PopulateFileInfo(ByRef $aArray, $iIndex, $sFilePath) Local $sFileName = _GetFileName($sFilePath) Local $sArch = _DetectArchitecture($sFilePath) $aArray[$iIndex][0] = $sFilePath $aArray[$iIndex][1] = $sFileName $aArray[$iIndex][2] = _FormatFileSize(FileGetSize($sFilePath)) $aArray[$iIndex][3] = $sArch $aArray[$iIndex][4] = "_GetBinData_" & _SanitizeName($sFileName) & "_" & $sArch EndFunc ;==>_PopulateFileInfo #EndRegion ; *** FILE AND DATA HANDLING *** #Region ; *** CORE CODE GENERATION *** ; ------------------------------------------------------------------------------------------------- ; Function: _GenerateCodeBundle(ByRef $aFiles, $bAddHelpers, $iChunkSize) ; Purpose: The main code generation engine. Creates the full script content. ; ------------------------------------------------------------------------------------------------- Func _GenerateCodeBundle(ByRef $aFiles, $bAddHelpers, $iChunkSize) Local $sOutput = "; Generated by AutoIt Embedded File Generator - TRONG.PRO" & @CRLF $sOutput &= "; Total files: " & UBound($aFiles) & @CRLF $sOutput &= "; Generated on: " & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF & @CRLF For $i = 0 To UBound($aFiles) - 1 $sOutput &= _GenerateHexFunction($aFiles[$i][0], $aFiles[$i][4], $aFiles[$i][1], $aFiles[$i][3], "$sHexData", $iChunkSize) & @CRLF & @CRLF Next If $bAddHelpers Then If UBound($aFiles) = 1 Then $sOutput &= _GenerateHelperFunction($aFiles[0][4], $aFiles[0][1]) Else $sOutput &= _GenerateMasterHelperFunctionFromArray($aFiles) EndIf EndIf Return $sOutput EndFunc ;==>_GenerateCodeBundle ; ------------------------------------------------------------------------------------------------- ; Function: _GenerateHexFunction($sFilePath, $sFuncName, $sFileName, $sArch, $sVarName, $iChunkSize) ; Purpose: Reads a binary file and wraps its hex content in an AutoIt function. ; ------------------------------------------------------------------------------------------------- Func _GenerateHexFunction($sFilePath, $sFuncName, $sFileName, $sArch, $sVarName = "$sHexData", $iChunkSize = 4000) Local $hFile = FileOpen($sFilePath, 16) If $hFile = -1 Then ConsoleWrite("! Error: Unable to open file in binary mode: " & $sFilePath & @CRLF) Return "" EndIf Local $bData = FileRead($hFile) FileClose($hFile) If @error Or $bData = "" Then ConsoleWrite("! Error reading binary data from file: " & $sFilePath & @CRLF) Return "" EndIf Local $sHexWithPrefix = StringToBinary($bData) If StringLeft($sVarName, 1) <> "$" Then $sVarName = "$" & $sVarName Local $sOutput = "Func " & $sFuncName & "()" & @CRLF $sOutput &= @TAB & '; This function holds the hex data for ' & $sFileName & @CRLF $sOutput &= @TAB & '; File size: ' & _FormatFileSize(FileGetSize($sFilePath)) & @CRLF $sOutput &= @TAB & '; Architecture: ' & $sArch & @CRLF $sOutput &= @TAB & '; Generated by AutoIt Embedded File Generator' & @CRLF Local $iHexLen = StringLen($sHexWithPrefix) $sOutput &= @TAB & "Local " & $sVarName & " = '" & StringMid($sHexWithPrefix, 1, $iChunkSize) & "'" & @CRLF For $i = $iChunkSize + 1 To $iHexLen Step $iChunkSize $sOutput &= @TAB & $sVarName & " &= '" & StringMid($sHexWithPrefix, $i, $iChunkSize) & "'" & @CRLF Next $sOutput &= @CRLF & @TAB & "Return " & $sVarName & @CRLF $sOutput &= "EndFunc ;==>" & $sFuncName Return $sOutput EndFunc ;==>_GenerateHexFunction ; ------------------------------------------------------------------------------------------------- ; Function: _GenerateHelperFunction($sFuncName, $sOriginalFileName) ; Purpose: Generates a helper function to deploy a single embedded file. ; ------------------------------------------------------------------------------------------------- Func _GenerateHelperFunction($sFuncName, $sOriginalFileName) Local $sHelperFunc = @CRLF & @CRLF $sHelperFunc &= '; =================================================================' & @CRLF $sHelperFunc &= '; Helper function to deploy the file from hex data.' & @CRLF $sHelperFunc &= '; =================================================================' & @CRLF $sHelperFunc &= 'Func _DeployFileFromHex()' & @CRLF $sHelperFunc &= @TAB & 'Local $sHexData = ' & $sFuncName & '()' & @CRLF $sHelperFunc &= @TAB & 'Local $Deploy_Dir = @TempDir' & @CRLF $sHelperFunc &= @TAB & 'If $sHexData = "" Then Return SetError(1, 0, MsgBox(16, "Error", "Hex data is empty."))' & @CRLF $sHelperFunc &= @CRLF $sHelperFunc &= @TAB & 'Local $sOutputFilename = "' & $sOriginalFileName & '"' & @CRLF $sHelperFunc &= @TAB & 'Local $sTempFilePath = $Deploy_Dir & "\" & $sOutputFilename' & @CRLF $sHelperFunc &= @TAB & 'Local $hFile = FileOpen($sTempFilePath, 18)' & @CRLF $sHelperFunc &= @TAB & 'If $hFile = -1 Then Return SetError(2, 0, MsgBox(16, "Error", "Failed to open file for writing at: " & $sTempFilePath))' & @CRLF $sHelperFunc &= @CRLF $sHelperFunc &= @TAB & 'FileWrite($hFile, BinaryToString($sHexData))' & @CRLF $sHelperFunc &= @TAB & 'FileClose($hFile)' & @CRLF $sHelperFunc &= @CRLF $sHelperFunc &= @TAB & 'If Not FileExists($sTempFilePath) Then Return SetError(3, 0, MsgBox(16, "Error", "Failed to write file to: " & $sTempFilePath))' & @CRLF $sHelperFunc &= @CRLF $sHelperFunc &= @TAB & 'MsgBox(64, "Success", "File deployed successfully to:" & @CRLF & $sTempFilePath)' & @CRLF $sHelperFunc &= @TAB & 'Return $sTempFilePath' & @CRLF $sHelperFunc &= 'EndFunc ;==>_DeployFileFromHex' & @CRLF & @CRLF $sHelperFunc &= '; Example usage: _DeployFileFromHex()' & @CRLF Return $sHelperFunc EndFunc ;==>_GenerateHelperFunction ; ------------------------------------------------------------------------------------------------- ; Function: _GenerateMasterHelperFunctionFromArray(ByRef $aFiles) ; Purpose: Generates a master helper function to deploy all embedded files. ; ------------------------------------------------------------------------------------------------- Func _GenerateMasterHelperFunctionFromArray(ByRef $aFiles) Local $sDelimiter = '"/"' Local $sHelperFunc = "#include <Array.au3>" & @CRLF & @CRLF $sHelperFunc &= '; =================================================================' & @CRLF $sHelperFunc &= '; Master helper function to deploy all embedded files.' & @CRLF $sHelperFunc &= '; =================================================================' & @CRLF $sHelperFunc &= 'Func _DeployAllFiles()' & @CRLF $sHelperFunc &= @TAB & 'Local $aResults[0]' & @CRLF $sHelperFunc &= @TAB & 'Local $Deploy_Dir = @TempDir' & @CRLF $sHelperFunc &= @CRLF For $i = 0 To UBound($aFiles) - 1 Local $sFileName = $aFiles[$i][1] Local $sFuncName = $aFiles[$i][4] Local $sArch = $aFiles[$i][3] $sHelperFunc &= @TAB & '; Deploy ' & $sFileName & ' (' & $sArch & ')' & @CRLF $sHelperFunc &= @TAB & 'Local $sHexData' & $i & ' = ' & $sFuncName & '()' & @CRLF $sHelperFunc &= @TAB & 'If $sHexData' & $i & ' <> "" Then' & @CRLF $sHelperFunc &= @TAB & @TAB & 'Local $sOutputPath' & $i & ' = $Deploy_Dir & "\' & $sFileName & '"' & @CRLF $sHelperFunc &= @TAB & @TAB & 'Local $hFile' & $i & ' = FileOpen($sOutputPath' & $i & ', 18)' & @CRLF $sHelperFunc &= @TAB & @TAB & 'If $hFile' & $i & ' <> -1 Then' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'FileWrite($hFile' & $i & ', BinaryToString($sHexData' & $i & '))' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'FileClose($hFile' & $i & ')' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'If FileExists($sOutputPath' & $i & ') Then' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & @TAB & '_ArrayAdd($aResults, "' & $sFileName & '" & ' & $sDelimiter & ' & $sOutputPath' & $i & ' & ' & $sDelimiter & ' & "Success")' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'Else' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & @TAB & '_ArrayAdd($aResults, "' & $sFileName & '" & ' & $sDelimiter & ' & "' & $sArch & '" & ' & $sDelimiter & ' & "Write failed")' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'EndIf' & @CRLF $sHelperFunc &= @TAB & @TAB & 'Else' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & '_ArrayAdd($aResults, "' & $sFileName & '" & ' & $sDelimiter & ' & "' & $sArch & '" & ' & $sDelimiter & ' & "Cannot create file")' & @CRLF $sHelperFunc &= @TAB & @TAB & 'EndIf' & @CRLF $sHelperFunc &= @TAB & 'Else' & @CRLF $sHelperFunc &= @TAB & @TAB & '_ArrayAdd($aResults, "' & $sFileName & '" & ' & $sDelimiter & ' & "' & $sArch & '" & ' & $sDelimiter & ' & "No hex data")' & @CRLF $sHelperFunc &= @TAB & 'EndIf' & @CRLF $sHelperFunc &= @CRLF Next $sHelperFunc &= @TAB & '; Display results' & @CRLF $sHelperFunc &= @TAB & 'Local $sReport = "Deployment Results (" & UBound($aResults) & " files):" & @CRLF & @CRLF' & @CRLF $sHelperFunc &= @TAB & 'For $i = 0 To UBound($aResults) - 1' & @CRLF $sHelperFunc &= @TAB & @TAB & 'Local $aParts = StringSplit($aResults[$i], ' & $sDelimiter & ')' & @CRLF $sHelperFunc &= @TAB & @TAB & 'If $aParts[0] = 3 Then' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & '$sReport &= "• " & $aParts[1] & ": " & $aParts[3]' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'If $aParts[3] = "Success" Then' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & @TAB & '$sReport &= " → " & $aParts[2]' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'Else' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & @TAB & '$sReport &= " (" & $aParts[2] & ")"' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & 'EndIf' & @CRLF $sHelperFunc &= @TAB & @TAB & @TAB & '$sReport &= @CRLF' & @CRLF $sHelperFunc &= @TAB & @TAB & 'EndIf' & @CRLF $sHelperFunc &= @TAB & 'Next' & @CRLF $sHelperFunc &= @CRLF $sHelperFunc &= @TAB & 'MsgBox(64, "Deployment Complete", $sReport)' & @CRLF $sHelperFunc &= @TAB & 'Return $aResults' & @CRLF $sHelperFunc &= 'EndFunc ;==>_DeployAllFiles' & @CRLF & @CRLF $sHelperFunc &= '; Example usage: _DeployAllFiles()' & @CRLF Return $sHelperFunc EndFunc ;==>_GenerateMasterHelperFunctionFromArray #EndRegion ; *** CORE CODE GENERATION *** #Region ; *** PE HEADER AND ARCHITECTURE DETECTION *** ; ------------------------------------------------------------------------------------------------- ; Function: _DetectArchitecture($sFilePath) ; Purpose: A wrapper that returns the architecture string for a file. ; ------------------------------------------------------------------------------------------------- Func _DetectArchitecture($sFilePath) Local $sArch = _DetectArchitecture_File($sFilePath) If @error Then Return "N/A" Return $sArch EndFunc ;==>_DetectArchitecture ; ------------------------------------------------------------------------------------------------- ; Function: _DetectArchitecture_File($sFilePath) ; Purpose: Reads a file's PE headers to identify the target CPU architecture. ; ------------------------------------------------------------------------------------------------- Func _DetectArchitecture_File($sFilePath) If Not FileExists($sFilePath) Then Return SetError(1, 0, "FILE_NOT_FOUND") Local $hFile = FileOpen($sFilePath, 16) If $hFile = -1 Then Return SetError(2, 0, "CANNOT_OPEN_FILE") Local $bDOSHeader = FileRead($hFile, 64) If @error Then FileClose($hFile) Return SetError(3, 0, "CANNOT_READ_DOS_HEADER") EndIf If BinaryMid($bDOSHeader, 1, 2) <> "0x4D5A" Then FileClose($hFile) Return "Not PE" EndIf Local $iPEOffset = _BinaryToInt(BinaryMid($bDOSHeader, 61, 4)) FileSetPos($hFile, $iPEOffset, $FILE_BEGIN) Local $bPESig = FileRead($hFile, 4) If @error Or $bPESig <> "0x50450000" Then FileClose($hFile) Return SetError(5, 0, "INVALID_PE_SIGNATURE") EndIf Local $bCOFF = FileRead($hFile, 2) FileClose($hFile) If @error Then Return SetError(6, 0, "CANNOT_READ_COFF_HEADER") Local $iMachine = _BinaryToInt($bCOFF) Switch $iMachine Case 0x014c Return "x86" Case 0x8664 Return "x64" Case 0x01c0, 0x01c4 Return "ARM" Case 0xAA64 Return "ARM64" Case 0x0200 Return "IA64" Case Else Return "UNKNOWN_0x" & Hex($iMachine, 4) EndSwitch EndFunc ;==>_DetectArchitecture_File ; ------------------------------------------------------------------------------------------------- ; Function: _BinaryToInt($bData) ; Purpose: Converts a little-endian binary string to an integer value. ; ------------------------------------------------------------------------------------------------- Func _BinaryToInt($bData) Local $iResult = 0 For $i = 1 To BinaryLen($bData) $iResult += Number(BinaryMid($bData, $i, 1)) * (256 ^ ($i - 1)) Next Return $iResult EndFunc ;==>_BinaryToInt #EndRegion ; *** PE HEADER AND ARCHITECTURE DETECTION *** #Region ; *** UTILITY FUNCTIONS *** ; ------------------------------------------------------------------------------------------------- ; Function: _SanitizeName($sInput) ; Purpose: Removes illegal characters from a string to make it a valid function name. ; ------------------------------------------------------------------------------------------------- Func _SanitizeName($sInput) Local $sCleaned = StringRegExpReplace($sInput, "[^a-zA-Z0-9_]", "") If StringLeft($sCleaned, 1) = "$" Then $sCleaned = StringTrimLeft($sCleaned, 1) Return $sCleaned EndFunc ;==>_SanitizeName ; ------------------------------------------------------------------------------------------------- ; Function: _GetFileName($sFilePath) ; Purpose: Extracts the filename and extension from a full path. ; ------------------------------------------------------------------------------------------------- Func _GetFileName($sFilePath) Return StringRegExpReplace($sFilePath, "^.*\\", "") EndFunc ;==>_GetFileName ; ------------------------------------------------------------------------------------------------- ; Function: _FormatFileSize($iBytes) ; Purpose: Converts a file size in bytes into a human-readable string (KB, MB, GB). ; ------------------------------------------------------------------------------------------------- Func _FormatFileSize($iBytes) If $iBytes < 1024 Then Return $iBytes & " B" ElseIf $iBytes < 1048576 Then Return Round($iBytes / 1024, 1) & " KB" ElseIf $iBytes < 1073741824 Then Return Round($iBytes / 1048576, 2) & " MB" Else Return Round($iBytes / 1073741824, 2) & " GB" EndIf EndFunc ;==>_FormatFileSize ; ------------------------------------------------------------------------------------------------- ; Function: _ValidateChunkSize($iChunkSize) ; Purpose: Ensures the chunk size is within a valid range. ; ------------------------------------------------------------------------------------------------- Func _ValidateChunkSize($iChunkSize) ; First, check if the input from the GUI is a string containing only digits. If Not StringIsDigit($iChunkSize) Then Return 4000 ; If not, it's invalid, return the default value. EndIf ; If it is a digit string, convert it to a real number. Local $nChunkSize = Number($iChunkSize) If ($iChunkSize < 100) Or ($iChunkSize > 4000) Then Return 4000 EndIf Return Int($iChunkSize) EndFunc ;==>_ValidateChunkSize ; ------------------------------------------------------------------------------------------------- ; Function: _SaveStringToFile($sFilePath, $sContent) ; Purpose: A robust function to save a string to a file. ; Returns: True on success, False on failure. ; ------------------------------------------------------------------------------------------------- Func _SaveStringToFile($sFilePath, $sContent) Local $hFile = FileOpen($sFilePath, 2) If $hFile = -1 Then Return False Local $bSuccess = FileWrite($hFile, $sContent) FileClose($hFile) Return $bSuccess EndFunc ;==>_SaveStringToFile #EndRegion ; *** UTILITY FUNCTIONS *** !4 points
-
Updated to WebP v0.4.1 build 2025-07-10 beta. You can now play WebP animation in a separated thread. See WebP Example14 .1.au3 and WebP Example15.au34 points
-
... Fun topic ... 🙂 just for fun, here are some tweaks to @argumentum's script above to simulate dragging the window and see the visual effect of the movement under the icons...nice effect. To make the window follow the mouse, press F9 once; to stop the movement, press F9 again. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 HotKeySet('{F9}', F9) ; <-- Global $bFlag = False ; <-- Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE If $bFlag Then WinMove($hGUI,'',MouseGetPos(0),MouseGetPos(1)) EndIf WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate Func F9() $bFlag = Not $bFlag EndFunc4 points
-
Auto(it)Runs This script utilizes the sysinternals autorunsc command-line tool to scan and analyze autorun entries on a Windows system. https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns The script's primary function is to extract information from the autorunsc.exe scan results, to Autoit, which can be used for various purposes and understanding system startup behavior. Using the $STDOUT stream and not the -c switch (Print output as CSV), so that you don't have to export the data to disk every time I explored it experimentally, and these are the results. ; https://www.autoitscript.com/forum/topic/213070-autoitruns/ ;---------------------------------------------------------------------------------------- ; Title...........: Auto(it)Runs.au3 ; Description.....: This script utilizes the sysinternals `autorunsc` command-line tool ; to scan and analyze autorun entries on a Windows system. ; The script's primary function is to extract information from the autorun scan results, ; which can be used for various purposes and understanding system startup behavior. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.9 ; Note............: Testet in Win10 22H2 Date:10/08/2025 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #RequireAdmin #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <StringConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> Example() ;--------------------------------------------------------------------------------------- Func Example() Local $sCMD = CreateCmdGUI() ConsoleWrite("$sCMD=" & $sCMD & @CRLF) Local $aEntries = AutorunSnapshot($sCMD) If @error Then ConsoleWrite("! @error:" & @error & " " & $aEntries & @CRLF) Local $iPos = StringInStr($sCMD, '-o "') ; check if -o Switch in $sCMD then execute the output file If $iPos > 1 Then ShellExecute(StringLeft(StringTrimLeft($sCMD, $iPos + 3), StringInStr(StringTrimLeft($sCMD, $iPos + 3), '"') - 1)) Else DisplayGUI($aEntries, "Autorun Entries") EndIf EndFunc ;==>Example ;--------------------------------------------------------------------------------------- Func CreateCmdGUI() ; Optional GUI to build the autorunsc cmdline ; Switches for the "-a" group (Group A) Local $aGroupA[18][3] = [ _ [0, "*", "All"], [0, "b", "Boot execute"], [0, "c", "Codecs"], _ [0, "d", "Appinit DLLs"], [0, "e", "Explorer addons"], [0, "g", "Sidebar gadgets"], _ [0, "h", "Image hijacks"], [0, "i", "Internet Explorer addons"], [0, "k", "Known DLLs"], _ [0, "l", "Logon startups (default)"], [0, "m", "WMI entries"], [0, "n", "Winsock protocol"], _ [0, "o", "Office addins"], [0, "p", "Printer monitor DLLs"], [0, "r", "LSA security providers"], _ [0, "s", "Services & non-disabled drivers"], [0, "t", "Scheduled tasks"], [0, "w", "Winlogon entries"] _ ] ; Switches for other parameters (Group B) Local $aGroupB[12][3] = [ _ [0, "-ct", "Print as tab-delimited"], [0, "-c", "Print as CSV"], [0, "-x", "Print output as XML"], _ [0, "-o", "Write output to the file."], [0, "-h", "Show file hashes."], [0, "-m", "Hide Microsoft entries"], _ [0, "-t", "Show timestamps in normalized UTC."], [0, "-s", "Verify digital signatures"], _ [0, "-u", "Show unsigned/unknown files"], [0, "-vrs", "VirusTotal check & upload"], _ [0, "-nobanner", "Do not show startup banner"], [0, "*", "Scan all user profiles"] _ ] ; Create the Autorunsc GUI GUICreate("Autorunsc GUI", 600, 560) GUISetFont(9, 400, 0, "Tahoma") ; Create the input box for the command GUICtrlCreateLabel("Generated Command:", 10, 10, 200, 20) Local $idInputbox = GUICtrlCreateInput("", 10, 30, 580, 25, $ES_AUTOHSCROLL) GUICtrlSetState($idInputbox, $GUI_DISABLE) ; Create the input box for the output file Local $idLblOutFile = GUICtrlCreateLabel("Output file:", 310, 420, 200, 20) GUICtrlSetState(-1, $GUI_HIDE) Local $idOutFile = GUICtrlCreateInput("output.txt", 310, 440, 260, 20) GUICtrlSetState(-1, $GUI_HIDE) Local $idExecuteButton = GUICtrlCreateButton("Execute", 420, 500, 140, 25) ; Create Group 1 for "-a" switches on the left GUICtrlCreateGroup("Autostart Entry Selection (-a)", 10, 70, 280, 480) Local $iX = 20, $iY = 90 For $i = 0 To UBound($aGroupA) - 1 $aGroupA[$i][0] = GUICtrlCreateCheckbox($aGroupA[$i][1] & " (" & $aGroupA[$i][2] & ")", $iX, $iY, 260, 20) $iY += 25 Next ; Set default selections in (Group A) GUICtrlSetState($aGroupA[1][0], $GUI_CHECKED) ; -a b GUICtrlSetState($aGroupA[9][0], $GUI_CHECKED) ; -a l GUICtrlCreateGroup("", -99, -99, 1, 1) ; Close the group ; Create Group 2 for other switches on the right GUICtrlCreateGroup("Other Options", 300, 70, 290, 330) $iX = 310 $iY = 90 For $i = 0 To UBound($aGroupB) - 1 $aGroupB[$i][0] = GUICtrlCreateCheckbox($aGroupB[$i][1] & " (" & $aGroupB[$i][2] & ")", $iX, $iY, 260, 20) $iY += 25 Next ; Set default selections in (Group B) GUICtrlSetState($aGroupB[11][0], $GUI_CHECKED) ; * user profiles GUICtrlCreateGroup("", -99, -99, 1, 1) ; Close the group GUISetState(@SW_SHOW) Local $nMsg, $bNeedUpdate = True While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $aGroupA[0][0] ; Handle the "All" checkbox logic If GUICtrlRead($aGroupA[0][0]) = $GUI_CHECKED Then For $i = 1 To UBound($aGroupA) - 1 GUICtrlSetState($aGroupA[$i][0], $GUI_DISABLE) GUICtrlSetState($aGroupA[$i][0], $GUI_UNCHECKED) Next Else For $i = 1 To UBound($aGroupA) - 1 GUICtrlSetState($aGroupA[$i][0], $GUI_ENABLE) Next EndIf $bNeedUpdate = True Case $aGroupA[1][0] To $aGroupA[17][0] ; Handle other "-a" checkboxes If GUICtrlRead($nMsg) = $GUI_CHECKED Then GUICtrlSetState($aGroupA[0][0], $GUI_DISABLE) Else Local $bAnyChecked = False For $i = 1 To UBound($aGroupA) - 1 If GUICtrlRead($aGroupA[$i][0]) = $GUI_CHECKED Then $bAnyChecked = True ExitLoop EndIf Next If Not $bAnyChecked Then GUICtrlSetState($aGroupA[0][0], $GUI_ENABLE) EndIf EndIf $bNeedUpdate = True Case $idOutFile $bNeedUpdate = True Case $idExecuteButton Return GUICtrlRead($idInputbox) Case $aGroupB[0][0] To $aGroupB[11][0] $bNeedUpdate = True EndSwitch If $bNeedUpdate Then Local $sCommand = "" Local $sAGroupSwitches = "" ; Build the string for "-a" switches For $i = 0 To UBound($aGroupA) - 1 If GUICtrlRead($aGroupA[$i][0]) = $GUI_CHECKED Then $sAGroupSwitches &= $aGroupA[$i][1] EndIf Next ; Add the "-a" switch only once if any option is selected If StringLen($sAGroupSwitches) > 0 Then $sCommand &= " -a " & $sAGroupSwitches ; Add switches from Group B For $i = 0 To UBound($aGroupB) - 1 If GUICtrlRead($aGroupB[$i][0]) = $GUI_CHECKED Then $sCommand &= " " & $aGroupB[$i][1] EndIf Next ; if Output file is checked If GUICtrlRead($aGroupB[3][0]) = $GUI_CHECKED Then GUICtrlSetState($idLblOutFile, $GUI_SHOW) GUICtrlSetState($idOutFile, $GUI_SHOW) Local $sOutFile = @ScriptDir & "\" & GUICtrlRead($idOutFile) $sCommand = StringReplace($sCommand, "-o", '-o "' & $sOutFile & '"') ; Set default selections in (Group B) GUICtrlSetState($aGroupB[0][0], $GUI_ENABLE) ; -ct GUICtrlSetState($aGroupB[1][0], $GUI_ENABLE) ; -c GUICtrlSetState($aGroupB[2][0], $GUI_ENABLE) ; -x GUICtrlSetState($aGroupB[4][0], $GUI_ENABLE) ; -h GUICtrlSetState($aGroupB[6][0], $GUI_ENABLE) ; -t GUICtrlSetState($aGroupB[7][0], $GUI_ENABLE) ; -s GUICtrlSetState($aGroupB[8][0], $GUI_ENABLE) ; -u GUICtrlSetState($aGroupB[9][0], $GUI_ENABLE) ; -vrs GUICtrlSetState($aGroupB[10][0], $GUI_ENABLE) ; -nobanner Else GUICtrlSetState($idLblOutFile, $GUI_HIDE) GUICtrlSetState($idOutFile, $GUI_HIDE) ; Set default selections in (Group B) GUICtrlSetState($aGroupB[0][0], $GUI_CHECKED) ; -ct GUICtrlSetState($aGroupB[0][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[1][0], $GUI_UNCHECKED) ; -c GUICtrlSetState($aGroupB[1][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[2][0], $GUI_UNCHECKED) ; -x GUICtrlSetState($aGroupB[2][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[4][0], $GUI_UNCHECKED) ; -h GUICtrlSetState($aGroupB[4][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[6][0], $GUI_CHECKED) ; -t GUICtrlSetState($aGroupB[6][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[7][0], $GUI_UNCHECKED) ; -s GUICtrlSetState($aGroupB[7][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[8][0], $GUI_UNCHECKED) ; -u GUICtrlSetState($aGroupB[8][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[9][0], $GUI_UNCHECKED) ; -vrs GUICtrlSetState($aGroupB[9][0], $GUI_DISABLE) GUICtrlSetState($aGroupB[10][0], $GUI_CHECKED) ; -nobanner GUICtrlSetState($aGroupB[10][0], $GUI_DISABLE) EndIf GUICtrlSetData($idInputbox, $sCommand) $bNeedUpdate = False EndIf WEnd Exit ;Return SetError(1, 0, "") EndFunc ;==>CreateCmdGUI ;--------------------------------------------------------------------------------------- Func AutorunSnapshot($sCmdSwitches = '-a bl -t -ct -nobanner *') ; Extract Entries to array ; https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns ; Make sure autorunsc.exe is located in a subfolder named "Autoruns" in @ScriptDir Local Const $sAutorunscPath = @ScriptDir & "\Autoruns\autorunsc64.exe" ; Verify that autorunsc.exe exists. If Not FileExists($sAutorunscPath) Then Return SetError(1, 0, "! Error: The autorunsc.exe file was not found") ; Usage: autorunsc [-a <*|bdeghiklmoprsw>] [-c|-ct] [-h] [-m] [-s] [-u] [-vt] [-o <output file>] [[-z <systemroot> <userprofile>] | [user]]] ; -a Autostart entry selection: ; * All. ; b Boot execute. ; c Codecs. ; d Appinit DLLs. ; e Explorer addons. ; g Sidebar gadgets (Vista and higher) ; h Image hijacks. ; i Internet Explorer addons. ; k Known DLLs. ; l Logon startups (this is the default). ; m WMI entries. ; n Winsock protocol and network providers. ; o Office addins. ; p Printer monitor DLLs. ; r LSA security providers. ; s Autostart services and non-disabled drivers. ; t Scheduled tasks. ; w Winlogon entries. ; -c Print output as CSV. ; -ct Print output as tab-delimited values. ; -h Show file hashes. ; -m Hide Microsoft entries (signed entries if used with -s). ; -o Write output to the specified file. ; -s Verify digital signatures. ; -t Show timestamps in normalized UTC (YYYYMMDD-hhmmss). ; -u If VirusTotal check is enabled, show files that are unknown ; by VirusTotal or have non-zero detection, otherwise show only ; unsigned files. ; -x Print output as XML. ; -v[rs] Query VirusTotal (www.virustotal.com) for malware based on file hash. ; Add 'r' to open reports for files with non-zero detection. Files ; reported as not previously scanned will be uploaded to VirusTotal ; if the 's' option is specified. Note scan results may not be ; available for five or more minutes. ; -vt Before using VirusTotal features, you must accept ; VirusTotal terms of service. See: https://www.virustotal.com/en/about/terms-of-service/ ; If you haven't accepted the terms and you omit this ; option, you will be interactively prompted. ; -z Specifies the offline Windows system to scan. ; user Specifies the name of the user account for which ; autorun items will be shown. Specify '*' to scan ; all user profiles. ; -nobanner Do not display the startup banner and copyright message. ; Construct the command to run autorunsc.exe ; Local $sCommand = '"' & $sAutorunscPath & '" -a bl -m -t -ct -nobanner *' <<- Default -<< Local $sCommand = '"' & $sAutorunscPath & '" ' & $sCmdSwitches ; $sCmdSwitches = '-a bl -t -ct -nobanner *' ; Run autorunsc.exe Local $iPID = Run($sCommand, "", @SW_HIDE, $STDOUT_CHILD) ; Wait until the process has closed ProcessWaitClose($iPID) ; Read the Stdout stream of the PID Local $sOutput = StdoutRead($iPID) ; Possible ANSI to UTF16 conversion $sOutput = BinaryToString(StringToBinary($sOutput, $SB_ANSI), $SB_UTF16LE) ; <<- important -<< ;ConsoleWrite("$sOutput=" & $sOutput & @CRLF) ; Use StringSplit to split the output of StdoutRead to an array. All carriage returns (@CR) are stripped and @LF is used as the delimiter. Local $aDataArray = StringSplit(StringTrimRight(StringStripCR($sOutput), 1), @LF) If @error Then Return SetError(2, 0, "! Error: It appears there was an error trying to get the STDOUT.") ;_ArrayDisplay($aDataArray) Local $aPart, $aData[UBound($aDataArray)][12], $idx = 0 ; Skip 1st line with header For $i = 2 To UBound($aDataArray) - 1 $aPart = StringSplit($aDataArray[$i], @TAB) If $aPart[0] = 11 Then $idx += 1 $aData[$idx][0] = $idx $aData[$idx][1] = $aPart[1] $aData[$idx][2] = $aPart[2] $aData[$idx][3] = $aPart[3] $aData[$idx][4] = $aPart[4] $aData[$idx][5] = $aPart[5] $aData[$idx][6] = $aPart[6] $aData[$idx][7] = $aPart[7] $aData[$idx][8] = $aPart[8] $aData[$idx][9] = $aPart[9] $aData[$idx][10] = $aPart[10] $aData[$idx][11] = $aPart[11] EndIf Next ;_ArrayDisplay($aData) ReDim $aData[$idx + 1][12] $aData[0][0] = $idx $aData[0][1] = "Time" $aData[0][2] = "EntryLocation" $aData[0][3] = "Entry" $aData[0][4] = "Enabled" $aData[0][5] = "Category" $aData[0][6] = "Profile" $aData[0][7] = "Description" $aData[0][8] = "Company" $aData[0][9] = "ImagePath" $aData[0][10] = "Version" $aData[0][11] = "LaunchString" Return $aData EndFunc ;==>AutorunSnapshot ;--------------------------------------------------------------------------------------- Func DisplayGUI($aItems, $sTitle = "") ; Optional GUI to Display the extracted Entries ; Create GUI GUICreate($sTitle, 1600, 600) Local $idListview = GUICtrlCreateListView("", 2, 2, 1600, 600, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) GUISetState(@SW_SHOW) ; ["idx", "Time", "EntryLocation", "Entry", "Enabled", "Category", "Profile", "Description", "Company", "ImagePath", "Version", "LaunchString"] ; Add columns _GUICtrlListView_AddColumn($idListview, "idx", 30) _GUICtrlListView_AddColumn($idListview, "Time", 100) _GUICtrlListView_AddColumn($idListview, "EntryLocation", 450) _GUICtrlListView_AddColumn($idListview, "Entry", 150) _GUICtrlListView_AddColumn($idListview, "Enabled", 60) _GUICtrlListView_AddColumn($idListview, "Category", 60) _GUICtrlListView_AddColumn($idListview, "Profile", 60) _GUICtrlListView_AddColumn($idListview, "Description", 100) _GUICtrlListView_AddColumn($idListview, "Company", 100) _GUICtrlListView_AddColumn($idListview, "ImagePath", 300) _GUICtrlListView_AddColumn($idListview, "Version", 40) _GUICtrlListView_AddColumn($idListview, "LaunchString", 300) _GUICtrlListView_SetItemCount($idListview, $aItems[0][0]) ; remove $aItems header _ArrayDelete($aItems, 0) _GUICtrlListView_AddArray($idListview, $aItems) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>DisplayGUI ;--------------------------------------------------------------------------------------- Please, every comment is appreciated! leave your comments and experiences here! Thank you very much3 points
-
Open all files starting with "0" in subfolder?
pixelsearch and 2 others reacted to Diana (Cda) for a topic
Thank you so much for everyone's kind help! Apologies in delay in replying, I don't know what I was doing wrong, but it was like beating my head against the wall somehow (my mom passed away 3 months ago, so suspect I was also just having trouble with details, who knows <sigh>). But I came back to this again. When I leave my apartment, I like to shut down all things running apps in the systray except what's there "automatically", as it were. Then when I come home, start up those extra things I like to have running when I'm around. Ultimately, pixelsearch kindly wrote up the code to include that TRUE statement which escaped me because of the presentation before as just describing what to do (and I see now I must still have been affected by mom's passing as I just couldn't make heads or tails of that). Here is the what worked just now, but I removed the suggested "_ArrayDisplay($array)" line as that created some havoc, too, and I find it's not really necessary, just an extra confusing step, it seems. #include <file.au3> #include <Array.au3> Local $array = _FileListToArray(@ScriptDir & "\Startup\", "0*.*", 1, TRUE) ;_ArrayDisplay($array) For $i = 1 To $array[0] ShellExecute($array[$i]) Next Thank you!3 points -
JSON UDF in pure AutoIt
AspirinJunkie and 2 others reacted to WildByDesign for a topic
Absolutely. Please keep in mind that I am a complete AutoIt rookie. The examples show JSON code already in the example scripts as Global variables and parse/manipulate from there. The thing that would help a rookie like me the most would be to have an example script and an example .json file. The script would load the .json file from disk, parse json, modify some data and save those changes back to .json file on disk. That would have helped my rookie situation a lot. However, I also understand that some of that is outside of the responsibility for the UDF. But from an example perspective still would be beneficial. By the way, thank you all for your help. Cheers!3 points -
JSON UDF in pure AutoIt
Musashi and 2 others reacted to AspirinJunkie for a topic
If you then want to write to the theme with _JSON_addChangeDelete() (which could make sense due to the nested structure), then you basically only need to determine the first free array index. Since you have an AutoIt data structure after _JSON_Parse(), you basically only need to make a Ubound to the themes array: #include "JSON.au3" ; your input JSON string Global $sJSONRAW = '{"workbench.startupEditor":"none","breadcrumbs.enabled":false,"window.controlsStyle":"custom","workbench.activityBar.location":"hidden","window.customTitleBarVisibility":"auto","window.titleBarStyle":"custom","workbench.colorCustomizations":{"editor.background":"#00000060","terminal.background":"#00000060"},"theme":"Existing Theme 1","themes":[{"name":"Existing Theme 1","tab":{"background":"#00000080","unfocusedBackground":"#00000000"},"tabRow":{"background":"#00000000","unfocusedBackground":"#00000000"},"window":{"applicationTheme":"light","useMica":true}},{"name":"Existing Theme 2","tab":{"background":"#00000080","unfocusedBackground":"#00000000"},"tabRow":{"background":"#00000000","unfocusedBackground":"#00000000"},"window":{"applicationTheme":"light","useMica":true}},{"name":"Existing Theme 3","tab":{"background":"#00000080","unfocusedBackground":"#00000000"},"tabRow":{"background":"#00000000","unfocusedBackground":"#00000000"},"window":{"applicationTheme":"light","useMica":true}},{"name":"Existing Theme 4","tab":{"background":"#00000080","unfocusedBackground":"#00000000"},"tabRow":{"background":"#00000000","unfocusedBackground":"#00000000"},"window":{"applicationTheme":"light","useMica":true}}]}' ; parse JSON string into nested AutoIt data structure: Global $vJSON = _JSON_Parse($sJSONRAW) If @error Then Exit MsgBox(0,"Erro", "Error " & @error & " during parsing the JSON string") ; print to console to check the structure of the input JSON string ConsoleWrite("------- Input --------- " & @CRLF & _JSON_Generate($vJSON) & @CRLF & @CRLF) ; determine the number of elements already in the array "themes" Global $iNewIdx = UBound($vJSON["themes"]) ; add the new theme at the first free index: _JSON_addChangeDelete($vJSON, "theme", "Default Theme Test") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].name", "Default Theme Test") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].tab.background", "#00000020") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].tab.unfocusedBackground", "#00000000") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].tabRow.background", "#00000000") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].tabRow.unfocusedBackground", "#00000000") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].window.applicationTheme", "dark") _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "].window.useMica", true) ; create JSON string out of the AutoIt datastructure and print it to the console ConsoleWrite("------- Output --------- " & @CRLF & _JSON_Generate($vJSON) & @CRLF & @CRLF) Exactly - after _JSON_Parse() the whole thing no longer has anything to do with JSON but you have completely normal AutoIt data structures. However, this data is heavily nested. In AutoIt you can easily read information from nested data structures. But changing them is extremely cumbersome. To simplify exactly this, there is the _JSON_addChangeDelete() which (contrary to its name) has nothing to do with JSON but takes care of nested AutoIt data structures. The "cleaner" way mentioned is therefore already the way that _JSON_addChangeDelete() takes, as it changes the data at AutoIt level - just with a simpler interface than building the nested array element manually. Btw:, here's a little trick: With structures as complex as your theme description, you don't have to add everything manually. If you already know the structure beforehand, then simply describe it directly in JSON, have the theme element created completely from it and add it as a whole. In other words, you can replace the entire _JSON_addChangeDelete() in the example with a single one (similar to the jq example above): _JSON_addChangeDelete($vJSON, "themes[" & $iNewIdx & "]", _JSON_Parse('{"name":"Default Theme Test","tab":{"background":"#00000020","unfocusedBackground":"#00000000"},"tabRow":{"background":"#00000000","unfocusedBackground":"#00000000"},"window":{"applicationTheme":"dark","useMica":true}}'))3 points -
3 points
-
Hello everyone, I'm excited to share a new AutoIt UDF library: SafeArray UDF. This library simplifies working with COM SafeArrays and VARIANT structures, making it easier to interact with COM objects (like Excel, ADO, or other applications) in AutoIt scripts. Key Features Bidirectional Conversion: Convert AutoIt arrays to COM SafeArrays and vice versa (up to 5 dimensions). SafeArray Management: Create, modify, access, and destroy SafeArrays using functions like _SafeArrayCreate, _SafeArrayGetElement, _SafeArrayPutElement, and _SafeArrayDestroy. VARIANT Support: Convert AutoIt data (integers, strings, arrays, COM objects) to VARIANTs and back with _VariantSet and _VariantRead. BSTR Handling: Allocate, read, and free COM strings with _SysAllocString, _SysReadString, and _SysFreeString. 32/64-bit Compatibility: Works with AutoIt 3.3+ without external dependencies, except Date.au3 for $VT_DATE types. Error Handling: Uses @error to report issues (e.g., invalid pointers, incorrect dimensions). Why Use This UDF? SafeArrays are a standard for passing multi-dimensional arrays in COM interfaces. This UDF streamlines their use in AutoIt, eliminating the complexity of direct DLL calls. It’s perfect for working with COM applications like Excel or databases via ADO that rely on SafeArrays. Simple Example #include "SafeArray.au3" Func Example_VT_FILETIME() Local $tVar = DllStructCreate($tagVARIANT) Local $tSystemTime = _Date_Time_GetSystemTime() Local $tFileTime = _Date_Time_SystemTimeToFileTime($tSystemTime) ; Set the FILETIME into the VARIANT _VariantSet(DllStructGetPtr($tVar), $tFileTime, $VT_FILETIME) ; Read the FILETIME from the VARIANT Local $sDateTime = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_FILETIME: " & $sDateTime & @CRLF) ; Should display current date/time ; Clean up _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VT_FILETIME ; Run the example Example_VT_FILETIME() #include "SafeArray.au3" Func Example_VariantTypes1() Local $tVar = DllStructCreate($tagVARIANT) ; Test VT_DATE _VariantSet(DllStructGetPtr($tVar), "2025/08/03 12:34:56", $VT_DATE) ConsoleWrite("VT_DATE: " & _VariantRead(DllStructGetPtr($tVar)) & @CRLF) ; Devrait afficher 2025/08/03 12:34:56 ; Test VT_IDISPATCH Local $oObj = ObjCreate("Scripting.Dictionary") _VariantSet(DllStructGetPtr($tVar), $oObj, $VT_DISPATCH) Local $oRead = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_IDISPATCH IsObj: " & IsObj($oRead) & @CRLF) _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VariantTypes1 Example_VariantTypes1() #include "SafeArray.au3" #include<WinAPICom.au3> Func _VariantTypes() Local $tVar = DllStructCreate($tagVARIANT) ; Test VT_DATE _VariantSet(DllStructGetPtr($tVar), "2025/08/03 12:34:56", $VT_DATE) ConsoleWrite("VT_DATE: " & _VariantRead(DllStructGetPtr($tVar)) & @CRLF) ; Devrait afficher 2025/08/03 12:34:56 ;VT_CLSID Local $oGUID = _WinAPI_CreateGUID() _VariantSet(DllStructGetPtr($tVar), $oGUID, $VT_CLSID) Local $oGUIDRead = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_CLSID : " & $oGUIDRead & @CRLF) _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VariantTypes _VariantTypes() SafeArray.zip SafeArray.au33 points
-
AutoIt Extension for Visual Studio Code
SOLVE-SMART and 2 others reacted to LoganCH for a topic
Released v1.0.14 today! Changed Node package update. Sets editor.minimap.showRegionSectionHeaders to false for AutoIt scripts. Optimized editor command registrations. Enhancements to syntax definition file. Fixed Usage of wrong Au3Check encoding for the file path string. View and Rate on VSCode Marketplace View and Rate on OpenVSX Star, Submit Issues, and Contribute on GitHub3 points -
I want to share a framework that I am using in my "Taskbar Program" project. ; =============================================================================================================================== ; SCRIPT: Controller-Worker-Task Manager Framework ; AUTHOR: Dao Van Trong - TRONG.PRO ; VERSION: 4.0 (Optimized, INI-driven, Tray-Only) ; DESCRIPTION: This script implements a robust Controller-Worker-Task architecture for running background processes. ; It is designed to be a flexible framework for automation tasks. ; ; ARCHITECTURE: ; - Controller: The main process that runs persistently. It has no GUI and is controlled entirely via a system tray icon. ; Its responsibilities include: ; 1. Reading the configuration from 'Configs.ini'. ; 2. Creating and managing the tray menu. ; 3. Starting, stopping, and monitoring Worker processes. ; 4. Launching one-shot Task processes. ; 5. Automatically reloading the configuration when 'Configs.ini' is modified. ; ; - Workers: Long-running background processes that perform recurring tasks (e.g., monitoring, syncing). ; They are started and stopped by the Controller and run completely hidden. ; Each worker monitors the Controller and will self-terminate if the Controller exits. ; ; - Tasks: Short-lived background processes that perform a single, one-shot action (e.g., generate a report). ; They can be configured to run exclusively (locking all other tasks) or concurrently. ; They can also be configured to run as a separate sub-process or directly within the Controller's process. ; ; HOW IT WORKS: ; - IPC (Inter-Process Communication): Communication between the Controller and Workers is handled via the Windows Registry. ; The Controller writes a signal to a specific registry key to gracefully shut down a Worker. ; - Asynchronous Operations: All monitoring (process status, config file changes) and Worker functions are handled ; asynchronously using AdlibRegister, ensuring the Controller remains responsive. ; - Configuration: All Workers and Tasks are defined in the master arrays within this script, but they are enabled, ; disabled, and configured via an external 'Configs.ini' file. This allows for easy customization without ; modifying the source code. ; - Logging: The script generates a detailed log file ('manager.log') in the same directory, recording all major ; events like startup, shutdown, worker status changes, and errors. ; =============================================================================================================================== #include <TrayConstants.au3> #include <Array.au3> #include <File.au3> #include <FileConstants.au3> ; =============================================================================================================================== ; --- GLOBAL CONSTANTS AND VARIABLES ; =============================================================================================================================== ; --- Settings --- Global Const $g_sConfigFile = @ScriptDir & "\Configs.ini" Global Const $g_sLogFile = @ScriptDir & "\Manager.log" Global $g_sAppName = "Controller-Worker-Task Manager" Global $g_iCheckConfigInterval = 10000 Global $g_sLastConfigModDate = "" ; --- Registry & IPC --- Global Const $g_sRegBase = "HKCU\Software\ControllerWorkerApp" Global Const $g_iAdlibCheckInterval = 1000 Global Const $g_iGracefulShutdownTimeout = 3000 ; --- Status Constants for internal logic --- Global Const $STATUS_STOPPED = 0, $STATUS_RUNNING = 1, $STATUS_ERROR = 2 ; --- Task Execution Mode & Type Constants --- Global Const $TASK_MODE_EXCLUSIVE = 0, $TASK_MODE_CONCURRENT = 1 Global Const $TASK_RUN_TYPE_SUBAPP = 0, $TASK_RUN_TYPE_DIRECT = 1 ; --- Menu Type Constants --- Global Const $MENU_TYPE_MAIN = 0, $MENU_TYPE_SUB = 1 ; --- MASTER DATA STRUCTURES (Hard-coded definitions) --- ; [InternalName, DisplayName, FunctionName, MenuType] Global Const $g_aMasterWorkers[10][4] = [ _ ["CheckResources", "Check Resources", "Worker1Function", $MENU_TYPE_MAIN], _ ["SyncFiles", "Sync Files", "Worker2Function", $MENU_TYPE_MAIN], _ ["MonitorNetwork", "Monitor Network", "Worker3Function", $MENU_TYPE_MAIN], _ ["BackupDB", "Backup DB", "Worker4Function", $MENU_TYPE_SUB], _ ["CleanupLogs", "Cleanup Logs", "Worker5Function", $MENU_TYPE_SUB], _ ["ProcessEmails", "Process Emails", "Worker6Function", $MENU_TYPE_SUB], _ ["AutoScreenshot", "Auto Screenshot", "Worker7Function", $MENU_TYPE_SUB], _ ["MonitorTemp", "Monitor Temp", "Worker8Function", $MENU_TYPE_SUB], _ ["CheckUpdates", "Check Updates", "Worker9Function", $MENU_TYPE_SUB], _ ["SecurityScan", "Security Scan", "Worker10Function", $MENU_TYPE_SUB] _ ] ; [InternalName, DisplayName, FunctionName, MenuType, ExecutionMode, RunType] Global Const $g_aMasterTasks[10][6] = [ _ ["QuickCleanup", "Quick Cleanup", "TaskA_Function", $MENU_TYPE_MAIN, $TASK_MODE_EXCLUSIVE, $TASK_RUN_TYPE_SUBAPP], _ ["GenerateReport", "Generate Report", "TaskB_Function", $MENU_TYPE_MAIN, $TASK_MODE_EXCLUSIVE, $TASK_RUN_TYPE_SUBAPP], _ ["SendNotification", "Send Notification (Direct)", "TaskJ_Function", $MENU_TYPE_MAIN, $TASK_MODE_EXCLUSIVE, $TASK_RUN_TYPE_DIRECT], _ ["TaskC", "Run Task C (Direct)", "TaskC_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_DIRECT], _ ["TaskD", "Run Task D", "TaskD_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP], _ ["TaskE", "Run Task E", "TaskE_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP], _ ["TaskF", "Run Task F", "TaskF_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP], _ ["TaskG", "Run Task G", "TaskG_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP], _ ["TaskH", "Run Task H", "TaskH_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP], _ ["TaskI", "Run Task I", "TaskI_Function", $MENU_TYPE_SUB, $TASK_MODE_CONCURRENT, $TASK_RUN_TYPE_SUBAPP] _ ] ; --- Dynamic Data Structures (Populated from Master based on INI) --- Global $g_aWorkers, $g_iNumWorkers Global $g_aTasks, $g_iNumTasks ; --- Tray Menu Control Variables --- Global $g_aWorkerTrayItems[1], $g_aTaskTrayItems[1], $g_iTrayExit ; --- Shared Global Variables for Worker processes --- Global $g_sWorkerInternalName, $g_iControllerPID, $g_sWorkerRegKey ; =============================================================================================================================== ; --- MAIN SCRIPT LOGIC ; =============================================================================================================================== _Main() ;/** ; * @brief Main entry point of the script. ; * ; * Determines whether to run as the Controller or as a sub-process (Worker/Task) ; * based on the command-line arguments. ; */ Func _Main() If $CmdLine[0] > 0 Then Local $aCmd = StringSplit($CmdLine[1], ":") If $aCmd[0] < 2 Then Exit Local $sType = $aCmd[1], $sInternalName = $aCmd[2], $iControllerPID = ($CmdLine[0] > 1 ? $CmdLine[2] : 0) Switch $sType Case "worker" _RunAsWorker($sInternalName, $iControllerPID) Case "task" _RunAsTask($sInternalName) EndSwitch Else _RunAsController() EndIf EndFunc ;==>_Main ; =============================================================================================================================== ; --- CONTROLLER FUNCTIONS ; =============================================================================================================================== ;/** ; * @brief Initializes the Controller process. ; * ; * This function sets up the entire Controller environment: ; * 1. Cleans up any leftover registry keys from previous runs. ; * 2. Loads the configuration from Configs.ini. ; * 3. Creates the tray menu. ; * 4. Registers Adlib functions for background monitoring. ; * 5. Starts the main event loop. ; */ Func _RunAsController() _CleanupAllRegistryKeys() _LoadConfiguration() _CreateTrayMenu() AdlibRegister("_CheckStatus_Adlib", $g_iAdlibCheckInterval) AdlibRegister("_CheckForConfigChanges_Adlib", $g_iCheckConfigInterval) _WriteLog("INFO: Controller started successfully.") _ControllerMainLoop() EndFunc ;==>_RunAsController ;/** ; * @brief Loads and parses the configuration from Configs.ini. ; * ; * If Configs.ini exists, it reads the settings and the disable lists. ; * If not, it uses the default configuration (all master items enabled). ; * It then populates the dynamic $g_aWorkers and $g_aTasks arrays with only the enabled items. ; * This function is optimized to count items first, then Dim the arrays once to avoid ReDim in a loop. ; */ Func _LoadConfiguration() Local $sDisabledWorkers = "", $sDisabledTasks = "" If FileExists($g_sConfigFile) Then $g_sLastConfigModDate = FileGetTime($g_sConfigFile, $FT_MODIFIED, $FT_STRING) $g_sAppName = IniRead($g_sConfigFile, "Settings", "AppName", "Controller Framework") $g_iCheckConfigInterval = IniRead($g_sConfigFile, "Settings", "CheckConfigInterval", 10000) $sDisabledWorkers = "," & IniRead($g_sConfigFile, "Workers", "Disable", "") & "," $sDisabledTasks = "," & IniRead($g_sConfigFile, "Tasks", "Disable", "") & "," Else $g_sLastConfigModDate = "" $sDisabledWorkers = "," $sDisabledTasks = "," EndIf Local $iWorkerCount = 0, $iTaskCount = 0 For $i = 0 To UBound($g_aMasterWorkers) - 1 If Not StringInStr($sDisabledWorkers, "," & $g_aMasterWorkers[$i][0] & ",") Then $iWorkerCount += 1 Next For $i = 0 To UBound($g_aMasterTasks) - 1 If Not StringInStr($sDisabledTasks, "," & $g_aMasterTasks[$i][0] & ",") Then $iTaskCount += 1 Next $g_iNumWorkers = $iWorkerCount $g_iNumTasks = $iTaskCount Dim $g_aWorkers[$g_iNumWorkers][7] Dim $g_aTasks[$g_iNumTasks][7] Local $iWorkerIdx = 0, $iTaskIdx = 0 For $i = 0 To UBound($g_aMasterWorkers) - 1 Local $sInternalName = $g_aMasterWorkers[$i][0] If StringInStr($sDisabledWorkers, "," & $sInternalName & ",") Then ContinueLoop $g_aWorkers[$iWorkerIdx][0] = $sInternalName $g_aWorkers[$iWorkerIdx][1] = $g_aMasterWorkers[$i][1] $g_aWorkers[$iWorkerIdx][2] = $g_aMasterWorkers[$i][2] $g_aWorkers[$iWorkerIdx][3] = 0 $g_aWorkers[$iWorkerIdx][4] = False $g_aWorkers[$iWorkerIdx][5] = $STATUS_STOPPED $g_aWorkers[$iWorkerIdx][6] = $g_aMasterWorkers[$i][3] $iWorkerIdx += 1 Next For $i = 0 To UBound($g_aMasterTasks) - 1 Local $sInternalName = $g_aMasterTasks[$i][0] If StringInStr($sDisabledTasks, "," & $sInternalName & ",") Then ContinueLoop $g_aTasks[$iTaskIdx][0] = $sInternalName $g_aTasks[$iTaskIdx][1] = $g_aMasterTasks[$i][1] $g_aTasks[$iTaskIdx][2] = $g_aMasterTasks[$i][2] $g_aTasks[$iTaskIdx][3] = 0 $g_aTasks[$iTaskIdx][4] = $g_aMasterTasks[$i][4] $g_aTasks[$iTaskIdx][5] = $g_aMasterTasks[$i][5] $g_aTasks[$iTaskIdx][6] = $g_aMasterTasks[$i][3] $iTaskIdx += 1 Next EndFunc ;==>_LoadConfiguration ;/** ; * @brief Creates the entire tray menu structure based on the loaded configuration. ; * ; * It iterates through the dynamic $g_aWorkers and $g_aTasks arrays and creates ; * main menu items or sub-menu items based on their MenuType property. ; * This ensures that the menu item index directly corresponds to the data array index. ; */ Func _CreateTrayMenu() Opt("TrayMenuMode", 3) TraySetToolTip($g_sAppName) ReDim $g_aWorkerTrayItems[$g_iNumWorkers] ReDim $g_aTaskTrayItems[$g_iNumTasks] Local $hSubWorkersMenu = 0, $hSubTasksMenu = 0 For $i = 0 To $g_iNumWorkers - 1 If $g_aWorkers[$i][6] = $MENU_TYPE_MAIN Then $g_aWorkerTrayItems[$i] = TrayCreateItem("[OFF] " & $g_aWorkers[$i][1]) Else If $hSubWorkersMenu = 0 Then $hSubWorkersMenu = TrayCreateMenu("Sub Workers") $g_aWorkerTrayItems[$i] = TrayCreateItem("[OFF] " & $g_aWorkers[$i][1], $hSubWorkersMenu) EndIf Next TrayCreateItem("") For $i = 0 To $g_iNumTasks - 1 If $g_aTasks[$i][6] = $MENU_TYPE_MAIN Then $g_aTaskTrayItems[$i] = TrayCreateItem($g_aTasks[$i][1]) Else If $hSubTasksMenu = 0 Then $hSubTasksMenu = TrayCreateMenu("Sub Tasks") $g_aTaskTrayItems[$i] = TrayCreateItem($g_aTasks[$i][1], $hSubTasksMenu) EndIf Next TrayCreateItem("") $g_iTrayExit = TrayCreateItem("Exit") TraySetState(1) EndFunc ;==>_CreateTrayMenu ;/** ; * @brief The main event loop for the Controller. ; * ; * It waits for and dispatches tray menu click events to the appropriate handler functions. ; */ Func _ControllerMainLoop() While 1 Local $iTrayMsg = TrayGetMsg() Switch $iTrayMsg Case 0 Case $g_iTrayExit _ExitController() Case Else Local $iIndex = _GetIndexFromTrayID($iTrayMsg, $g_aWorkerTrayItems) If $iIndex <> -1 Then _HandleWorkerClick($iIndex) ContinueLoop EndIf $iIndex = _GetIndexFromTrayID($iTrayMsg, $g_aTaskTrayItems) If $iIndex <> -1 Then _HandleTaskClick($iIndex) ContinueLoop EndIf EndSwitch Sleep(100) WEnd EndFunc ;==>_ControllerMainLoop ;/** ; * @brief Handles a click on a Worker menu item. ; * @param $iIndex The index of the clicked worker in the $g_aWorkers array. ; */ Func _HandleWorkerClick($iIndex) _UpdateWorkerState($iIndex, Not $g_aWorkers[$iIndex][4]) EndFunc ;==>_HandleWorkerClick ;/** ; * @brief Handles a click on a Task menu item. ; * @param $iIndex The index of the clicked task in the $g_aTasks array. ; */ Func _HandleTaskClick($iIndex) _RunTask($iIndex) EndFunc ;==>_HandleTaskClick ;/** ; * @brief Central function to change a worker's state (on/off). ; * @param $iIndex The index of the worker. ; * @param $bNewState The new state to apply (True for ON, False for OFF). ; */ Func _UpdateWorkerState($iIndex, $bNewState) $g_aWorkers[$iIndex][4] = $bNewState If $bNewState Then _StartWorker($iIndex) Else _StopWorker($iIndex) EndIf _UpdateTrayItemForWorker($iIndex) EndFunc ;==>_UpdateWorkerState ;/** ; * @brief Updates a worker's tray menu item text and checked state. ; * @param $iIndex The index of the worker. ; */ Func _UpdateTrayItemForWorker($iIndex) Local $sPrefix, $iTrayState If $g_aWorkers[$iIndex][4] Then $sPrefix = "[ON] " $iTrayState = $TRAY_CHECKED Else $sPrefix = "[OFF] " $iTrayState = $TRAY_UNCHECKED EndIf TrayItemSetText($g_aWorkerTrayItems[$iIndex], $sPrefix & $g_aWorkers[$iIndex][1]) TrayItemSetState($g_aWorkerTrayItems[$iIndex], $iTrayState) EndFunc ;==>_UpdateTrayItemForWorker ;/** ; * @brief Starts a worker sub-process. ; * @param $iIndex The index of the worker. ; */ Func _StartWorker($iIndex) If ProcessExists($g_aWorkers[$iIndex][3]) Then Return Local $sCommand = 'worker:' & $g_aWorkers[$iIndex][0] _WriteLog("INFO: Starting Worker '" & $g_aWorkers[$iIndex][1] & "'...") Local $iPID = _RunScript($sCommand) If $iPID > 0 Then $g_aWorkers[$iIndex][3] = $iPID $g_aWorkers[$iIndex][5] = $STATUS_RUNNING Else _WriteLog("ERROR: Failed to start Worker '" & $g_aWorkers[$iIndex][1] & "'.") $g_aWorkers[$iIndex][4] = False $g_aWorkers[$iIndex][5] = $STATUS_ERROR EndIf EndFunc ;==>_StartWorker ;/** ; * @brief Stops a worker sub-process gracefully. ; * @param $iIndex The index of the worker. ; */ Func _StopWorker($iIndex) Local $iPID = $g_aWorkers[$iIndex][3] If $iPID = 0 Or Not ProcessExists($iPID) Then $g_aWorkers[$iIndex][3] = 0 $g_aWorkers[$iIndex][5] = $STATUS_STOPPED Return EndIf _WriteLog("INFO: Stopping Worker '" & $g_aWorkers[$iIndex][1] & "' (PID: " & $iPID & ")...") Local $sRegKey = $g_sRegBase & "\" & $g_aWorkers[$iIndex][0] RegWrite($sRegKey, "Signal", "REG_SZ", "exit") If @error Then _WriteLog("ERROR: Failed to write exit signal to registry for " & $g_aWorkers[$iIndex][0]) Local $iResult = ProcessWaitClose($iPID, $g_iGracefulShutdownTimeout / 1000) If $iResult = 0 Then _WriteLog("WARN: Worker PID " & $iPID & " did not respond. Forcing shutdown.") ProcessClose($iPID) EndIf RegDelete($sRegKey) $g_aWorkers[$iIndex][3] = 0 $g_aWorkers[$iIndex][5] = $STATUS_STOPPED EndFunc ;==>_StopWorker ;/** ; * @brief Runs a task either directly or as a sub-process. ; * @param $iIndex The index of the task. ; */ Func _RunTask($iIndex) Local $sTaskName = $g_aTasks[$iIndex][1] _WriteLog("INFO: Running Task '" & $sTaskName & "'...") If $g_aTasks[$iIndex][5] = $TASK_RUN_TYPE_DIRECT Then TrayItemSetState($g_aTaskTrayItems[$iIndex], $TRAY_DISABLE) Call($g_aTasks[$iIndex][2], $sTaskName) TrayItemSetState($g_aTaskTrayItems[$iIndex], $TRAY_ENABLE) _WriteLog("INFO: Direct Task '" & $sTaskName & "' has completed.") Else If $g_aTasks[$iIndex][3] <> 0 And ProcessExists($g_aTasks[$iIndex][3]) Then Return Local $sCommand = 'task:' & $g_aTasks[$iIndex][0] Local $iPID = _RunScript($sCommand, False) If $iPID > 0 Then $g_aTasks[$iIndex][3] = $iPID _UpdateAllTaskMenusState() Else _WriteLog("ERROR: Failed to run Task '" & $sTaskName & "'.") EndIf EndIf EndFunc ;==>_RunTask ;/** ; * @brief Adlib function to monitor the status of running workers and tasks. ; */ Func _CheckStatus_Adlib() For $i = 0 To $g_iNumWorkers - 1 If $g_aWorkers[$i][4] And Not ProcessExists($g_aWorkers[$i][3]) Then _WriteLog("WARN: Worker '" & $g_aWorkers[$i][1] & "' died. Restarting...") $g_aWorkers[$i][5] = $STATUS_ERROR _UpdateTrayItemForWorker($i) _StartWorker($i) EndIf Next Local $bTaskStateChanged = False For $i = 0 To $g_iNumTasks - 1 If $g_aTasks[$i][5] = $TASK_RUN_TYPE_SUBAPP And $g_aTasks[$i][3] > 0 And Not ProcessExists($g_aTasks[$i][3]) Then $g_aTasks[$i][3] = 0 $bTaskStateChanged = True EndIf Next If $bTaskStateChanged Then _UpdateAllTaskMenusState() EndFunc ;==>_CheckStatus_Adlib ;/** ; * @brief Checks if any exclusive task is currently running as a sub-process. ; * @return True if an exclusive task is running, otherwise False. ; */ Func _IsExclusiveTaskRunning() For $i = 0 To $g_iNumTasks - 1 If $g_aTasks[$i][4] = $TASK_MODE_EXCLUSIVE And $g_aTasks[$i][3] > 0 And ProcessExists($g_aTasks[$i][3]) Then Return True EndIf Next Return False EndFunc ;==>_IsExclusiveTaskRunning ;/** ; * @brief Updates the enabled/disabled state of all task menu items based on current activity. ; */ Func _UpdateAllTaskMenusState() Local $bExclusiveRunning = _IsExclusiveTaskRunning() For $i = 0 To $g_iNumTasks - 1 If $bExclusiveRunning Then TrayItemSetState($g_aTaskTrayItems[$i], $TRAY_DISABLE) Else If $g_aTasks[$i][3] > 0 And ProcessExists($g_aTasks[$i][3]) Then TrayItemSetState($g_aTaskTrayItems[$i], $TRAY_DISABLE) Else TrayItemSetState($g_aTaskTrayItems[$i], $TRAY_ENABLE) EndIf EndIf Next EndFunc ;==>_UpdateAllTaskMenusState ;/** ; * @brief Adlib function to check for modifications to the Configs.ini file. ; */ Func _CheckForConfigChanges_Adlib() Local $iCurrentModDate = FileGetTime($g_sConfigFile, $FT_MODIFIED, $FT_STRING) If $iCurrentModDate <> $g_sLastConfigModDate Then _WriteLog("INFO: Configuration file change detected. Reloading...") _UnregisterAllMasterAdlibs() _StopAllWorkers() TraySetState(2) _LoadConfiguration() _CreateTrayMenu() _WriteLog("INFO: Configuration reloaded and menu recreated.") EndIf EndFunc ;==>_CheckForConfigChanges_Adlib ;/** ; * @brief Stops all currently active workers. ; */ Func _StopAllWorkers() For $i = 0 To $g_iNumWorkers - 1 If $g_aWorkers[$i][4] Then _StopWorker($i) Next EndFunc ;==>_StopAllWorkers ;/** ; * @brief A generic function to run the script as a sub-process. ; * @param $sArgument The argument to pass to the new process (e.g., "worker:MyWorker"). ; * @param $bPassControllerPID If True, the current controller's PID is passed as the second argument. ; * @return The PID of the new process, or 0 on failure. ; */ Func _RunScript($sArgument, $bPassControllerPID = True) Local $sControllerPID = ($bPassControllerPID ? " " & @AutoItPID : "") Local $sCommand = '"' & @ScriptFullPath & '" "' & $sArgument & '"' & $sControllerPID Local $sExecutable = (@Compiled ? "" : '"' & @AutoItExe & '" ') Return Run($sExecutable & $sCommand, @ScriptDir, @SW_HIDE) EndFunc ;==>_RunScript ;/** ; * @brief Performs all necessary cleanup before the Controller exits. ; */ Func _ExitController() _WriteLog("INFO: Controller shutting down...") _UnregisterAllMasterAdlibs() _CleanupAllRegistryKeys() _StopAllWorkers() Exit EndFunc ;==>_ExitController ;/** ; * @brief Unregisters all possible Adlib callbacks defined in the master lists. ; * ; * This is a crucial cleanup step to prevent orphaned callbacks, especially when reloading the configuration. ; */ Func _UnregisterAllMasterAdlibs() AdlibUnRegister("_CheckStatus_Adlib") AdlibUnRegister("_CheckForConfigChanges_Adlib") For $i = 0 To UBound($g_aMasterWorkers) - 1 AdlibUnRegister($g_aMasterWorkers[$i][2]) Next EndFunc ;==>_UnregisterAllMasterAdlibs ;/** ; * @brief Deletes the entire registry key used by the application for IPC. ; */ Func _CleanupAllRegistryKeys() RegDelete($g_sRegBase) If @error Then _WriteLog("ERROR: Failed to delete base registry key: " & $g_sRegBase) EndFunc ;==>_CleanupAllRegistryKeys ;/** ; * @brief Finds the array index corresponding to a given tray item ID. ; * @param $nID The tray item ID to find. ; * @param $aTrayItems The array of tray item IDs to search in. ; * @return The array index if found, otherwise -1. ; */ Func _GetIndexFromTrayID($nID, ByRef $aTrayItems) For $i = 0 To UBound($aTrayItems) - 1 If $aTrayItems[$i] = $nID Then Return $i Next Return -1 EndFunc ;==>_GetIndexFromTrayID ;/** ; * @brief Writes a message to both the console and the log file. ; * ; * This function provides a synchronized way to log events. Opening and closing the file ; * for each write minimizes the chance of file corruption from multiple processes. ; * @param $sMessage The message to log. ; */ Func _WriteLog($sMessage) Local $sTimeStamp = @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC Local $sFormattedMessage = $sTimeStamp & " - " & $sMessage & @CRLF ConsoleWrite($sFormattedMessage) Local $hFile = FileOpen($g_sLogFile, 2 + 8) ; Open in Write + Append mode to lock the file during write If $hFile = -1 Then Return FileWrite($hFile, $sFormattedMessage) FileClose($hFile) EndFunc ;==>_WriteLog ; =============================================================================================================================== ; --- WORKER / TASK SUB-PROCESS EXECUTION ; =============================================================================================================================== ;/** ; * @brief Initializes the script when run as a Worker sub-process. ; * @param $sInternalName The internal name of the worker to run. ; * @param $iControllerPID The PID of the parent Controller process to monitor. ; */ Func _RunAsWorker($sInternalName, $iControllerPID) $g_sWorkerInternalName = $sInternalName $g_iControllerPID = $iControllerPID $g_sWorkerRegKey = $g_sRegBase & "\" & $sInternalName RegDelete($g_sWorkerRegKey) Local $sFunction = "" For $i = 0 To UBound($g_aMasterWorkers) - 1 If $g_aMasterWorkers[$i][0] = $sInternalName Then $sFunction = $g_aMasterWorkers[$i][2] ExitLoop EndIf Next If $sFunction = "" Then Exit AdlibRegister($sFunction, 1000) AdlibRegister("_WorkerHeartbeat_Adlib", 2000) While 1 Sleep(100) WEnd EndFunc ;==>_RunAsWorker ;/** ; * @brief Adlib function for workers to monitor the Controller and exit signals. ; */ Func _WorkerHeartbeat_Adlib() If $g_iControllerPID > 0 And Not ProcessExists($g_iControllerPID) Then _WorkerExitGracefully() EndIf RegRead($g_sWorkerRegKey, "Signal") If @error Then _WorkerExitGracefully() Return EndIf If RegRead($g_sWorkerRegKey, "Signal") = "exit" Then _WorkerExitGracefully() EndIf EndFunc ;==>_WorkerHeartbeat_Adlib ;/** ; * @brief Performs all necessary cleanup for a Worker before it exits. ; */ Func _WorkerExitGracefully() AdlibUnRegister("_WorkerHeartbeat_Adlib") Local $sFunction = "" For $i = 0 To UBound($g_aMasterWorkers) - 1 If $g_aMasterWorkers[$i][0] = $g_sWorkerInternalName Then $sFunction = $g_aMasterWorkers[$i][2] ExitLoop EndIf Next If $sFunction <> "" Then AdlibUnRegister($sFunction) RegDelete($g_sWorkerRegKey) Exit EndFunc ;==>_WorkerExitGracefully ;/** ; * @brief Initializes the script when run as a Task sub-process. ; * @param $sInternalName The internal name of the task to run. ; */ Func _RunAsTask($sInternalName) Local $sFunction, $sDisplayName For $i = 0 To UBound($g_aMasterTasks) - 1 If $g_aMasterTasks[$i][0] = $sInternalName Then $sDisplayName = $g_aMasterTasks[$i][1] $sFunction = $g_aMasterTasks[$i][2] ExitLoop EndIf Next If $sFunction = "" Then Exit Call($sFunction, $sDisplayName) Exit EndFunc ;==>_RunAsTask ; =============================================================================================================================== ; --- SPECIFIC WORKER/TASK FUNCTIONS (IMPLEMENTATION) ; =============================================================================================================================== Func Worker1Function() _WriteLog("Worker 'Check Resources' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker1Function Func Worker2Function() _WriteLog("Worker 'Sync Files' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker2Function Func Worker3Function() _WriteLog("Worker 'Monitor Network' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker3Function Func Worker4Function() _WriteLog("Worker 'Backup DB' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker4Function Func Worker5Function() _WriteLog("Worker 'Cleanup Logs' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker5Function Func Worker6Function() _WriteLog("Worker 'Process Emails' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker6Function Func Worker7Function() _WriteLog("Worker 'Auto Screenshot' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker7Function Func Worker8Function() _WriteLog("Worker 'Monitor Temp' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker8Function Func Worker9Function() _WriteLog("Worker 'Check Updates' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker9Function Func Worker10Function() _WriteLog("Worker 'Security Scan' is running...") ; This is PlaceHoder - Your Code Repalce Here EndFunc ;==>Worker10Function Func TaskA_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(2000) EndFunc ;==>TaskA_Function Func TaskB_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(3000) EndFunc ;==>TaskB_Function Func TaskC_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskC_Function Func TaskD_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskD_Function Func TaskE_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskE_Function Func TaskF_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskF_Function Func TaskG_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskG_Function Func TaskH_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskH_Function Func TaskI_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1500) EndFunc ;==>TaskI_Function Func TaskJ_Function($sName) _WriteLog("Task '" & $sName & "' is running...") ; This is PlaceHoder - Your Code Repalce Here Sleep(1000) EndFunc ;==>TaskJ_Function !3 points
-
_WinAPI_SetWinEventHook() help file example - help
argumentum and 2 others reacted to junkew for a topic
Uia and event hooks are different things. UIA cannot catch all. The event windows hooks are technically a deeper layer. For this example I would just find a message with an event spy and build an example for that in the help file. UIA cannot do much with java ui controls or browser things like playwright can do. So most likely there is not one UI interception framework. Yes, a uia udf as part of AutoIT would be nice but it's a lot of work.😀3 points -
You could grab the event sent by Excel before a workbook gets closed. Something like this: #include <Excel.au3> HotKeySet("+!e", "_Exit") ;Shift-Alt-E to Exit the script MsgBox(64, "Excel UDF: Events Example", "Hotkey to exit the script: 'Shift-Alt-E'!") ; Create application object and open a workbook Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) ObjEvent($oWorkbook, "Workbook_") While 1 Sleep(10) WEnd Exit Func Workbook_BeforeClose() MsgBox(0, "WorkbookBeforeClose", "Name: " & $oWorkbook.Name) _Excel_Close($oExcel) _Exit() EndFunc ;==>Workbook_BeforeClose Func _Exit() Exit EndFunc ;==>_Exit This example works for the workbook opened by this script. If the user opens and closes another workbook nothing will happen.3 points
-
Another AutoIt extension for Visual Studio Code
SOLVE-SMART and 2 others reacted to genius257 for a topic
1.8.6 released! Only one change, the help box that appears when writing function parameters should not dissapear, when adding "," anymore. It took me a while and the solution is not perfect, but it should be better than the previous experience3 points -
I can only test on my Notebook with Win11 24H2 and the solution was to set parent to the WorkerW handle under Progman. I found also the information after midnight to force WorkerW under Progman using DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) but I was too sleepy to continue. ;Code by UEZ build 2025-07-18 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ #include <WinAPIGdi.au3> ;~ #include <Array.au3> Global $aPrimary = GetPrimaryMonitorCoords() If @error Then Exit MsgBox(16, "Error", "Unable to get primary monitor") Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i If Not $hProgman Then Exit MsgBox(16, "ERROR", "Couldn't find Progman", 30) _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 250, $SMTO_NORMAL) ;~ DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) ;~ Sleep(250) ;~ $i = 1 ;~ While True ;~ $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") ;~ $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW") ;~ If $hWorkerW Then ExitLoop ;~ $i += 1 ;~ If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) ;~ WEnd Global $hWorkerW = _WinAPI_FindWindowEx($hProgman, 0, "WorkerW", "") If $hWorkerW = 0 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) Local $aOrigin = GetDesktopOrigin() Local $iX = $aPrimary[0] - $aOrigin[0] Local $iY = $aPrimary[1] - $aOrigin[1] Global $hGUI = GUICreate("GUI behind Desktop icons", $aPrimary[4], $aPrimary[5], $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, $aPrimary[4], $aPrimary[5]) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE)) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _WinAPI_FindWindowEx($hParent, $hAfter, $sClass, $sTitle = "") Local $ret = DllCall("user32.dll", "hwnd", "FindWindowExW", "hwnd", $hParent, "hwnd", $hAfter, "wstr", $sClass, "wstr", $sTitle) If @error Or Not IsArray($ret) Then Return 0 Return $ret[0] EndFunc ;==>_WinAPI_FindWindowEx Func GetPrimaryMonitorCoords() Local $tPoint = DllStructCreate("int x;int y") $tPoint.x = 0 $tPoint.y = 0 Local $hMonitor = _WinAPI_MonitorFromPoint($tPoint, $MONITOR_DEFAULTTOPRIMARY) If Not $hMonitor Then Return SetError(1, 0, 0) Local $tMI = DllStructCreate("dword cbSize;long rcMonitor[4];long rcWork[4];dword dwFlags") DllStructSetData($tMI, "cbSize", DllStructGetSize($tMI)) Local $aCall = DllCall("user32.dll", "bool", "GetMonitorInfoW", "handle", $hMonitor, "ptr", DllStructGetPtr($tMI)) If @error Or Not $aCall[0] Then Return SetError(2, 0, 0) Local $iLeft = $tMI.rcMonitor(1) Local $iTop = $tMI.rcMonitor(2) Local $iRight = $tMI.rcMonitor(3) Local $iBottom = $tMI.rcMonitor(4) Local $iWidth = $iRight - $iLeft Local $iHeight = $iBottom - $iTop Local $a[6] = [$iLeft, $iTop, $iRight, $iBottom, $iWidth, $iHeight] Return $a EndFunc ;==>GetPrimaryMonitorCoords Func GetDesktopOrigin() Local $minX = 0, $minY = 0, $x, $y Local $i = 0, $tDevice, $aRet, $tDevMode, $aED While True $tDevice = DllStructCreate("dword cb; char DeviceName[32]; char DeviceString[128]; dword StateFlags; char DeviceID[128]; char DeviceKey[128]") $tDevice.cb = DllStructGetSize($tDevice) $aRet = DllCall("user32.dll", "bool", "EnumDisplayDevicesA", "ptr", 0, "dword", $i, "ptr", DllStructGetPtr($tDevice), "dword", 0) If @error Or Not $aRet[0] Then ExitLoop If BitAND($tDevice.StateFlags, 1) Then $tDevMode = DllStructCreate( _ "byte dmDeviceName[32]; word dmSpecVersion; word dmDriverVersion; word dmSize; word dmDriverExtra; dword dmFields;" & _ "long dmPositionX; long dmPositionY; dword dmDisplayOrientation; dword dmDisplayFixedOutput;" & _ "short dmColor; short dmDuplex; short dmYResolution; short dmTTOption; short dmCollate; char dmFormName[32];" & _ "ushort dmLogPixels; dword dmBitsPerPel; dword dmPelsWidth; dword dmPelsHeight;" & _ "dword dmDisplayFlags; dword dmDisplayFrequency; dword dmICMMethod; dword dmICMIntent;" & _ "dword dmMediaType; dword dmDitherType; dword dmReserved1; dword dmReserved2; dword dmPanningWidth; dword dmPanningHeight") $tDevMode.dmSize = DllStructGetSize($tDevMode) $aED = DllCall("user32.dll", "bool", "EnumDisplaySettingsA", "str", $tDevice.DeviceName, "dword", -1, "ptr", DllStructGetPtr($tDevMode)) If Not @error And $aED[0] Then $x = $tDevMode.dmPositionX $y = $tDevMode.dmPositionY If $x < $minX Then $minX = $x If $y < $minY Then $minY = $y EndIf EndIf $i += 1 WEnd Local $a[2] = [$minX, $minY] Return $a EndFunc ;==>GetDesktopOrigin3 points
-
It provides one of the WorkerW handles, not the WorkerW handle under Progman. 😉 This works for me: ;Code by UEZ build 2025-07-16 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i $i = 1 While True $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW", "") If $hWorkerW Then ExitLoop $i += 1 If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) WEnd Global $SWP = BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE) $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0,0,0,0, $SWP) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _WinAPI_FindWindowEx($hParent, $hAfter, $sClass, $sTitle = "") Local $ret = DllCall("user32.dll", "hwnd", "FindWindowExW", "hwnd", $hParent, "hwnd", $hAfter, "wstr", $sClass, "wstr", $sTitle) If @error Or Not IsArray($ret) Then Return 0 Return $ret[0] EndFunc3 points
-
Try this version : ; From Nine #include <WinAPIDiag.au3> #include <GDIPlus.au3> #include <GUIConstants.au3> ; Blend - Fade - Text Opt("MustDeclareVars", True) Example() Func Example() _GDIPlus_Startup() Local $hGUI = GUICreate("Example", 400, 400) GUISetBkColor(0xFFFF00) Local $idLabel = GUICtrlCreateLabel("", 75, 20, 250, 40) Local $hLabel = GUICtrlGetHandle($idLabel) GUISetState() Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hLabel) Local $hBrush = _GDIPlus_LineBrushCreate(0, 20, 250, 20, 0xFF606060, 0xFFFFFFFF) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate("Arial") Local $hFont = _GDIPlus_FontCreate($hFamily, 28, 2) Local $tLayout = _GDIPlus_RectFCreate(0, 0, 250, 40) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, "AutoIt Rulez !", $hFont, $tLayout, $hFormat) ;_WinAPI_DisplayStruct($aInfo[0], $tagGDIPRECTF) _GDIPlus_GraphicsDrawStringEx($hGraphic, "AutoIt Rulez !", $hFont, $aInfo[0], $hFormat, $hBrush) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_RESTORE _GDIPlus_GraphicsDrawStringEx($hGraphic, "AutoIt Rulez !", $hFont, $aInfo[0], $hFormat, $hBrush) Case $idLabel ConsoleWrite("Label was clicked" & @CRLF) EndSwitch WEnd _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example2 points
-
I wrote a dll and the wrapper to convert non-animated WebP images to a GDI/GDI+ format / encode any GDI+ supported image to WebP format for use in Autoit. What is WebP? You can find more information about WebP and WebP tools / source codes here: https://developers.google.com/speed/webp Maybe useful for one or the other... 🙂 WebP.au3: #cs Copyright (c) 2025 UEZ The following terms apply to the use of this code (AutoIt scripts and both DLLs), unless otherwise agreed upon in writing with the author: 1. **No commercial use** Any commercial usage - including but not limited to selling, licensing, integrating into commercial software, or using in revenue-generating products - is prohibited. 2. **Modification allowed, for non-commercial use only** You may modify or adapt the code as long as it remains non-commercial. Even in modified versions, the original author must be clearly credited as UEZ. 3. **Attribution required** In any non-commercial distribution or use, clear credit must be given to the original author: UEZ. For exceptions or commercial licensing, please contact: uez at hotmail de #ce ; More information about WebP: https://developers.google.com/speed/webp ; Copyright Google Inc. All Rights Reserved. ;Version 0.5.0 build 2025-08-10 beta #include-once #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <MsgBoxConstants.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <WinAPIConstants.au3> #include <WinAPISysWin.au3> ;~ #include <WinAPIDiag.au3> ;WEBP_HINT_ENUMARTION Enum $WEBP_HINT_DEFAULT = 0, _ ; default preset. $WEBP_HINT_PICTURE, _ ; digital picture, like portrait, inner shot $WEBP_HINT_PHOTO, _ ; outdoor photograph, with natural lighting $WEBP_HINT_GRAPH, _ ; Discrete tone image (graph, map-tile etc). $WEBP_HINT_LAST Global Const $tagWebPConfig = _ "long lossless;" & _ "float quality;" & _ "long method;" & _ "long image_hint;" & _ "long target_size;" & _ "float target_PSNR;" & _ "long segments;" & _ "long sns_strength;" & _ "long filter_strength;" & _ "long filter_sharpness;" & _ "long filter_type;" & _ "long autofilter;" & _ "long alpha_compression;" & _ "long alpha_filtering;" & _ "long alpha_quality;" & _ "long pass;" & _ "long show_compressed;" & _ "long preprocessing;" & _ "long partitions;" & _ "long partition_limit;" & _ "long emulate_jpeg_size;" & _ "long thread_level;" & _ "long low_memory;" & _ "long near_lossless;" & _ "long exact;" & _ "long use_delta_palette;" & _ "long use_sharp_yuv;" & _ "long qmin;" & _ "long qmax" Global Const $tagWebPBitstreamFeatures = "struct;long width; long height; long has_alpha; long has_animation; long format; ulong pad[5];endstruct" Global $g_hDLL ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_Ver ; Description ...: Displays the DLL version information in a messagebox window ; Syntax ........: WebP_Ver([$sPath2DLL = ""]) ; Parameters ....: $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: None ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_Ver($sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found DllCall($sDLL, "none", "WebP_DLL_Version") Return True EndFunc ;==>WebP_Ver ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_Ver2 ; Description ...: Returns the DLL version information ; Syntax ........: WebP_Ver([$sPath2DLL = ""]) ; Parameters ....: $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: DLL version ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_Ver2($sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Return DllCall($sDLL, "str", "Web_DLL_Version2")[0] EndFunc ;==>WebP_Ver2 ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapGetInfo ; Description ...: Gets some rudimentary information about the WebP image ; Syntax ........: WebP_BitmapGetInfo($sFilename[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - file to load ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: Struct ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapGetInfo($sFilename, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) ;file not found Local $iFileSize = FileGetSize($sFilename), $nBytes Local $tBuffer = DllStructCreate("struct;byte bin[" & $iFileSize & "];endstruct") Local Const $hFile = _WinAPI_CreateFile($sFilename, 2, 2) _WinAPI_ReadFile($hFile, $tBuffer, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) If Int(BinaryMid($tBuffer.bin, 1, 4)) <> 1179011410 Or Int(BinaryMid($tBuffer.bin, 9, 6)) <> 88331643929943 Then Return SetError(3, 0, 0) ;header must contain RIFF and WEBPVP Local $tWebPBitstreamFeatures = DllStructCreate($tagWebPBitstreamFeatures) Local $iReturn = DllCall($sDLL, "long", "WebP_BitmapGetInfo", "struct*", $tBuffer, "uint", $iFileSize, "struct*", $tWebPBitstreamFeatures) If $iReturn = 0 Then Return SetError(4, 0, 0) Return $tWebPBitstreamFeatures EndFunc ;==>WebP_BitmapGetInfo ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapCreateGDIp ; Description ...: Converts (decodes) a WebP image from disk to a GDI / GDI+ bitmap handle ; Syntax ........: WebP_BitmapCreateGDIp($sFilename[, $bGDIImage = False[, $bDither = False[, $iDitherStrength = 32[, ; $bCountColors = False[, $sPath2DLL = ""]]]]]) ; Parameters ....: $sFilename - file to load ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). If True then output is GDI bitmap handle. ; $bDither - [optional] a boolean value. Default is False. If true pseudo dithering (noise) will applied to image. ; $iDitherStrength - [optional] an integer value. Default is 32. Valid values are from 0 to 64. ; $bCountColors - [optional] a boolean value. Default is False. If True then the colors will be counted and saved in extended. Use @extended to get color count. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: GDI / GDIPlus bitmap handle and color count if $bCountColors = True in extended. ; Author ........: UEZ ; Modified ......: ; Remarks .......: For animated WebP images see below! Dithering makes only sense for images which are heavily compressed. ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapCreateGDIp($sFilename, $bGDIImage = False, $bDither = False, $iDitherStrength = 32, $bCountColors = False, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) ;file not found $iDitherStrength = $iDitherStrength > 64 ? 64 : $iDitherStrength < 0 ? 0 : $iDitherStrength Local $iFileSize = FileGetSize($sFilename), $nBytes If $iFileSize < 1 Then Return SetError(3, 0, 0) Local $tBuffer = DllStructCreate("byte bin[" & $iFileSize & "]") Local Const $hFile = _WinAPI_CreateFile($sFilename, 2, 2) _WinAPI_ReadFile($hFile, $tBuffer, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) If Int(BinaryMid($tBuffer.bin, 1, 4)) <> 1179011410 Or Int(BinaryMid($tBuffer.bin, 9, 6)) <> 88331643929943 Then Return SetError(4, 0, 0) ;header must contain RIFF and WEBPVP Local $tColors = DllStructCreate("struct;ulong cc;endstruct") Local Const $hBitmap = DllCall($sDLL, "ptr", "WebP_BitmapCreateGDIp", "struct*", $tBuffer, "uint", $iFileSize, "boolean", $bDither, "ubyte", $iDitherStrength, "boolean", $bGDIImage, "boolean", $bCountColors, "struct*", $tColors)[0] If $hBitmap = 0 Then Return SetError(5, 0, 0) Return SetExtended($tColors.cc, $hBitmap) EndFunc ;==>WebP_BitmapCreateGDIp ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapCreateGDIpFromMem ; Description ...: Converts (decodes) a WebP image from memory to a GDI / GDI+ bitmap handle ; Syntax ........: WebP_BitmapCreateGDIpFromMem($tBuffer[, $iBufferSize = 0[, $bGDIImage = False[, $bDither = False[, ; $iDitherStrength = 32[, $bCountColors = False[, $sPath2DLL = ""]]]]]]) ; Parameters ....: $tBuffer - a dll struct with WebP binary data as content or pointer to the memory data. ; $iBufferSize - the size of the binary data (file size). ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). If True then output is GDI bitmap handle. ; $bDither - [optional] a boolean value. Default is False. If true pseudo dithering (noise) will applied to image. ; $iDitherStrength - [optional] an integer value. Default is 32. Valid values are from 0 to 64. ; $bCountColors - [optional] a boolean value. Default is False. If True then the colors will be counted and saved in extended. Use @extended to get color count. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: GDI / GDIPlus bitmap handle and color count if $bCountColors = True in extended. ; Author ........: UEZ ; Modified ......: ; Remarks .......: Currently only WebP images are supported - no animated WebP images yet! ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapCreateGDIpFromMem($tBuffer, $iBufferSize = 0, $bGDIImage = False, $bDither = False, $iDitherStrength = 32, $bCountColors = False, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If $iBufferSize = 0 Then Return SetError(2, 0, 0) Local $binMem If IsPtr($tBuffer) Then Local $tMem = DllStructCreate("byte bin[" & $iBufferSize & "]", $tBuffer) $binMem = $tMem.bin Else $binMem = DllStructGetData($tBuffer, 1) EndIf If Int(BinaryMid($binMem, 1, 4)) <> 1179011410 Or Int(BinaryMid($binMem, 9, 6)) <> 88331643929943 Then Return SetError(3, 0, 0) ;header must contain RIFF and WEBPVP Local $tColors = DllStructCreate("ulong cc") Local Const $hBitmap = DllCall($sDLL, "ptr", "WebP_BitmapCreateGDIp", "struct*", $tBuffer, "uint", $iBufferSize, "boolean", $bDither, "ubyte", $iDitherStrength, "boolean", $bGDIImage, "boolean", $bCountColors, "struct*", $tColors)[0] If $hBitmap = 0 Then Return SetError(4, 0, 0) Return SetExtended($tColors.cc, $hBitmap) EndFunc ;==>WebP_BitmapCreateGDIpFromMem ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPLossySimpleFromBitmap ; Description ...: Converts a GDI+ bitmap to WebP lossy image and save it to HD ; Syntax ........: WebP_CreateWebPLossySimpleFromBitmap($sFilename, $hBitmap[, $iQuality = 75[, $sPath2DLL = ""]]) ; Parameters ....: $sFilename - file to load ; $hBitmap - GDIPlus bitmap handle ; $iQuality - [optional] an integer value. Default is 75. Valid range is 0 - 100. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 to -4 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPLossySimpleFromBitmap($sFilename, $hBitmap, $iQuality = 75, $sPath2DLL = "") If $sFilename = "" Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPLossySimpleFromBitmap", "wstr", $sFilename, "ptr", $hBitmap, "float", $iQuality)[0] If $iReturn = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>WebP_CreateWebPLossySimpleFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPLosslessSimpleFromBitmap ; Description ...: Converts a GDI+ bitmap to WebP lossless image and save it to HD ; Syntax ........: WebP_CreateWebPLosslessSimpleFromBitmap($sFilename, $hBitmap[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - file to load ; $hBitmap - GDIPlus bitmap handle ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 0 for failure, 1 for success. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPLosslessSimpleFromBitmap($sFilename, $hBitmap, $sPath2DLL = "") If $sFilename = "" Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPLosslessSimpleFromBitmap", "wstr", $sFilename, "ptr", $hBitmap)[0] If $iReturn = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>WebP_CreateWebPLosslessSimpleFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPAdvancedFromBitmap ; Description ...: Converts a bitmap to WebP lossy / lossless image and save it to HD ; Syntax ........: WebP_CreateWebPAdvancedFromBitmap($sFilename, $hBitmap[, $lossless = 0[, $quality = 75.0[, $method = 4[, ; $sns_strength = 50[, $filter_sharpness = 0[, $filter_strength = 60[, $pass = 6[, $near_lossless = 100[, ; $alpha_compression = 1[, $alpha_filtering = 1[, $alpha_quality = 100[, $target_size = 0[, ; $WebPImageHint = $WEBP_HINT_DEFAULT[, $NoSave = False[, $sPath2DLL = ""]]]]]]]]]]]]]]]) ; Parameters ....: $sFilename - a string value. ; $hBitmap - a handle value. ; $lossless - [optional] an unknown value. Default is 0. ; $quality - [optional] an unknown value. Default is 75.0. ; $method - [optional] a map. Default is 4. ; $sns_strength - [optional] a string value. Default is 50. ; $filter_sharpness - [optional] a floating point value. Default is 0. ; $filter_strength - [optional] a floating point value. Default is 60. ; $pass - [optional] a pointer value. Default is 6. ; $near_lossless - [optional] a general number value. Default is 100. ; $alpha_compression - [optional] an array of unknowns. Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. ; $WebPImageHint - [optional] an unknown value. Default is $WEBP_HINT_DEFAULT. ; $NoSave - [optional] an unknown value. Default is False. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: negative value up to -8 for failure, 1 for success or the struct with information (pointers, size) if $NoSave = True ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPAdvancedFromBitmap($sFilename, $hBitmap, $lossless = 0, $quality = 75.0, $method = 4, $sns_strength = 50, _ $filter_sharpness = 0, $filter_strength = 60, $pass = 6, $near_lossless = 100, $alpha_compression = 1, $alpha_filtering = 1, $alpha_quality = 100, _ $target_size = 0, $WebPImageHint = $WEBP_HINT_DEFAULT, $NoSave = False, $sPath2DLL = "") If $sFilename = "" And $NoSave = False Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $tMem = DllStructCreate("struct;ptr pPic; ptr pWriter; ptr pMemData; uint memsize;endstruct") Local $tWebPConfig = DllStructCreate($tagWebPConfig) FilltWebPConfigWithDefaults($tWebPConfig) With $tWebPConfig .lossless = $lossless .quality = ($quality < 0) ? 0 : (($quality > 100) ? 100 : $quality) .method = ($method < 0) ? 0 : (($method > 6) ? 6 : $method) .image_hint = ($WebPImageHint < 0) ? 0 : (($WebPImageHint > 4) ? 4 : $WebPImageHint) .target_size = $target_size ;in bytes .sns_strength = ($sns_strength < 0) ? 0 : (($sns_strength > 100) ? 100 : $sns_strength) .filter_strength = ($filter_strength < 0) ? 0 : (($filter_strength > 100) ? 100 : $filter_strength) .filter_sharpness = ($filter_sharpness < 0) ? 0 : (($filter_sharpness > 7) ? 7 : $filter_sharpness) .alpha_compression = $alpha_compression .alpha_filtering = ($alpha_filtering < 0) ? 0 : (($alpha_filtering > 2) ? 2 : $alpha_filtering) .alpha_quality = ($alpha_quality < 0) ? 0 : (($alpha_quality > 100) ? 100 : $alpha_quality) .pass = ($pass < 0) ? 0 : (($pass > 10) ? 10 : $pass) .near_lossless = ($near_lossless < 0) ? 0 : (($near_lossless > 100) ? 100 : $near_lossless) .exact = BitAND($near_lossless = 0, $lossless = 1) ? 1 : 0 EndWith Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPAdvancedFromBitmap", _ "wstr", $sFilename, _ ;Webp filename "ptr", $hBitmap, _ ;handle to GDI+ bitmap "struct*", $tWebPConfig, _ ;WebP config settings "bool", $NoSave, _ "struct*", $tMem)[0] If $iReturn < 0 Then Return SetError(3, 0, $iReturn) If $NoSave And $tMem.memsize = 0 Then SetError(4, 0, 0) Return $NoSave ? $tMem : $iReturn EndFunc ;==>WebP_CreateWebPAdvancedFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ReencodeWebPImage ; Description ...: Re-encodes a WebP image ; Syntax ........: WebP_ReencodeWebPImage($sFilename, $sOutfile, $tConfig[, $iNewWidth = 0[, $iNewHeight = 0[, $pImageData = 0[, ; $pImageDataSize = 0[, $sPath2DLL = ""]]]]]) ; Parameters ....: $sFilename - a string value. ; $sOutfile - a string value. ; $tConfig - a dll struct value. Must be a struct using $tagWebPConfig! ; $iNewWidth - [optional] an integer value. Default is 0. ; $iNewHeight - [optional] an integer value. Default is 0. ; $pImageData - [optional] a pointer value. Default is 0. A pointer to a memory block with loaded WebP image. ; $pImageDataSize - [optional] a pointer value. Default is 0. Size of the memory block. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 on success, otherwise error -> -1 to -11 ; Author ........: UEZ ; Modified ......: ; Remarks .......: If $pImageData is set, then $sFilename will be ignored in the WebP_ReencodeWebPImage() funtion ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ReencodeWebPImage($sFilename, $sOutfile, $tConfig, $iNewWidth = 0, $iNewHeight = 0, $pImageData = 0, $pImageDataSize = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) If Not IsDllStruct($tConfig) Then Return SetError(3, 0, 0) Local Const $iResult = DllCall($sDLL, "long", "WebP_ReencodeWebPImage", "wstr", $sFilename, "wstr", $sOutfile, "struct*", $tConfig, "ptr", $pImageData, "int", $pImageDataSize, "ushort", $iNewWidth, "ushort", $iNewHeight)[0] If $iResult < 1 Then Return SetError(4, 0, $iResult) Return $iResult EndFunc ;==>WebP_ReencodeWebPImage ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_FreeUp ; Description ...: Release the ressources from $tMem struct ; Syntax ........: WebP_FreeUp(Byref $tMem[, $sPath2DLL = ""]) ; Parameters ....: $tMem - [in/out] a dll struct value. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_FreeUp(ByRef $tMem, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_FreeUp", "struct*", $tMem)[0] Return $iReturn EndFunc ;==>WebP_FreeUp ; #FUNCTION# ==================================================================================================================== ; Name ..........: BitmapCountColors ; Description ...: Counts the colors used by the bitmap ; Syntax ........: BitmapCountColors($hBitmap) ; Parameters ....: $hBitmap - a handle to a GDI+ bitmap. ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). ; Return values .: Number of colors used by the image. ; Author ........: UEZ ; Modified ......: ; Remarks .......: The result may differ from other programs for JPG images depending on the decoder. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func BitmapCountColors($hBitmap = 0, $bGDIImage = False, $sPath2DLL = "") If IsPtr($hBitmap) = 0 Or $hBitmap = 0 Then SetError(1, 0, 0) Local Const $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "ulong", "BitmapCountColors", "ptr", $hBitmap)[0] If Not $iReturn Or @error Then Return SetError(3, 0, 0) Return $iReturn EndFunc ;==>BitmapCountColors ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ExtractAnimFramesToDisk ; Description ...: Extracts the frames of a WebP animated file ; Syntax ........: WebP_ExtractAnimFramesToDisk($sFile, $sDestPath = ""[, $sOutputFormat = "webp"[, $sPath2DLL = ""]]) ; Parameters ....: $sFilename - path to webp anim file. ; $sDestPath - destination folder. If empty then script path will be used. ; $sOutputFormat - [optional] a string value. Default is "webp". Any GDI+ supported or WebP image format. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: number of extracted frames on success, otherwise error -> -1 to -3 ; Author ........: UEZ ; Modified ......: ; Remarks .......: If output image format is WebP then frames will be saved lossless. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ExtractAnimFramesToDisk($sFilename, $sDestPath = "", $sOutputFormat = "webp", $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local Const $iResult = DllCall($sDLL, "long", "WebP_ExtractAnimFramesToDisk", "wstr", $sFilename, "wstr", $sDestPath, "str", StringStripWS($sOutputFormat, $STR_STRIPALL))[0] If $iResult < 1 Then Return SetError(2, 0, $iResult) Return $iResult EndFunc ;==>WebP_ExtractAnimFramesToDisk ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_GetAmountOfAnimFrames ; Description ...: Get the amount of frames from an animated webp file ; Syntax ........: WebP_GetAmountOfAnimFrames($sFilename[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - path to webp anim file. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 0 for failure, otherwise the amount of frames ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_GetAmountOfAnimFrames($sFilename, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local Const $iResult = DllCall($sDLL, "uint", "WebP_GetAmountOfAnimFrames", "wstr", $sFilename)[0] If Not $iResult Or @error Then Return SetError(2, 0, 0) Return $iResult EndFunc ;==>WebP_GetAmountOfAnimFrames ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ExtractAnimFramesToMem ; Description ...: Extracts all frames from a webp animated file to the memory ; Syntax ........: WebP_ExtractAnimFramesToMem($sFilename, Byref $iUB[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - path to webp anim file. ; $iUB - [in/out] an integer value. Needed to save the amount of data in struct array -> frames * 2 ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 0 for failure, otherwise struct array with pointer to the GDI+ image and frame delay ; Author ........: UEZ ; Modified ......: ; Remarks .......: You must dispose all frames when done. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ExtractAnimFramesToMem($sFilename, ByRef $iUB, $bDither = False, $iDitherStrength = 32, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local $iFrames = WebP_GetAmountOfAnimFrames($sFilename, $sPath2DLL) If Not $iFrames Or @error Then Return SetError(2, 0, 0) Local $tImgPtr = DllStructCreate((@AutoItX64 ? "int64 array[" : "int array[") & $iFrames * 2 + 2 & "]") Local Const $iResult = DllCall($sDLL, "long", "WebP_ExtractAnimFramesToMem", "wstr", $sFilename, "ptr*", DllStructGetPtr($tImgPtr), "boolean", $bDither, "ubyte", $iDitherStrength)[0] If $iResult < 1 Or @error Then Return SetError(4, $iResult, 0) $iUB = $iFrames * 2 Return $tImgPtr EndFunc ;==>WebP_ExtractAnimFramesToMem ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPCreateAnim ; Description ...: Creates an WebP animation file ; Syntax ........: WebP_CreateWebPCreateAnim($aFilenames, $sOutfile[, $quality = 75.0[, $lossless = 0[, $method = 4[, ; $filter_strength = 60[, $sns_strength = 50[, $pass = 6[, $filter_sharpness = 0[, ; $near_lossless = 100[, $alpha_compression = 1[, $alpha_filtering = 1[, $alpha_quality = 100[, ; $target_size = 0[, $loop_count = 0[, $WebPImageHint = $WEBP_HINT_DEFAULT[, $iDefaultDelay = 75[, ; $pCallback = 0[, $sPath2DLL = ""]]]]]]]]]]]]]]]]]) ; Parameters ....: $aFilenames - an 2D array of pathes to the image files and delay per frame. ; $sOutfile - filename of WebP animation output file. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $lossless - [optional] an unknown value. Default is 0. 0 for lossy encoding / 1 for lossless. ; $method - [optional] a map. Default is 4. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $pass - [optional] a pointer value. Default is 1. Number of entropy-analysis passes (in [1..10]). ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $near_lossless - [optional] a general number value. Default is 0 Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an array of unknowns. Default is 1. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 1. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. If non-zero, set the desired target size in bytes. ; $loop_count - [optional] an unknown value. Default is 0. 0 = endless. ; $WebPImageHint - [optional] an unknown value. Default is $WEBP_HINT_DEFAULT. ; $iDefaultDelay - [optional] an integer value. Default is 75. Delay in milli seconds. ; $pCallback - [optional] a pointer value. Default is 0. Pointer to a callback address for progress hook. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 to -12 ; Author ........: UEZ ; Modified ......: ; Remarks .......: All frames must have same image dimension. First image defines the dimension of the animation. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPCreateAnim($aFilenames, $sOutfile, $quality = 75.0, $lossless = 1, $method = 4, $filter_strength = 60, $sns_strength = 50, _ $pass = 1, $filter_sharpness = 0, $near_lossless = 0, $alpha_compression = 1, $alpha_filtering = 1, $alpha_quality = 100, _ $target_size = 0, $loop_count = 0, $WebPImageHint = $WEBP_HINT_DEFAULT, $iDefaultDelay = 75, $pCallback = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If $sOutfile = "" Then Return SetError(2, 0, 0) If Not IsArray($aFilenames) Or UBound($aFilenames) < 2 Then Return SetError(3, 0, 0) Local $iNumberOfFrames = UBound($aFilenames), $i Local $tArrayFrames = DllStructCreate("ptr ptr[" & $iNumberOfFrames & "]"), $tArrayFramesDelay = DllStructCreate("uint delay[" & $iNumberOfFrames & "]") Local $tArrayAnim[$iNumberOfFrames], $tArrayFrameDelay[$iNumberOfFrames], $aDim, $iW, $iH For $i = 0 To $iNumberOfFrames - 1 If Not FileExists($aFilenames[$i][0]) Then Return SetError(4, 0, 0) $tArrayAnim[$i] = DllStructCreate("wchar path[" & StringLen($aFilenames[$i][0]) + 1 & "]") $tArrayAnim[$i].path = $aFilenames[$i][0] $tArrayFrames.ptr(($i + 1)) = DllStructGetPtr($tArrayAnim[$i]) $tArrayFramesDelay.delay(($i + 1)) = (UBound($aFilenames, 2) ? ($aFilenames[$i][1] > 0 ? $aFilenames[$i][1] : $iDefaultDelay) : $iDefaultDelay) Next Local $tAnim = DllStructCreate("ptr pFrames;ptr pDelays") $tAnim.pFrames = DllStructGetPtr($tArrayFrames) $tAnim.pDelays = DllStructGetPtr($tArrayFramesDelay) If StringRight($sOutfile, 5) <> ".webp" Then $sOutfile &= ".webp" $loop_count = $loop_count < 0 ? 0 : $loop_count Local $tWebPConfig = DllStructCreate($tagWebPConfig) FilltWebPConfigWithDefaults($tWebPConfig) With $tWebPConfig .lossless = $lossless .quality = ($quality < 0) ? 0 : (($quality > 100) ? 100 : $quality) .method = ($method < 0) ? 0 : (($method > 6) ? 6 : $method) .image_hint = ($WebPImageHint < 0) ? 0 : (($WebPImageHint > 4) ? 4 : $WebPImageHint) .target_size = $target_size ;in bytes .sns_strength = ($sns_strength < 0) ? 0 : (($sns_strength > 100) ? 100 : $sns_strength) .filter_strength = ($filter_strength < 0) ? 0 : (($filter_strength > 100) ? 100 : $filter_strength) .filter_sharpness = ($filter_sharpness < 0) ? 0 : (($filter_sharpness > 7) ? 7 : $filter_sharpness) .alpha_compression = $alpha_compression .alpha_filtering = ($alpha_filtering < 0) ? 0 : (($alpha_filtering > 2) ? 2 : $alpha_filtering) .alpha_quality = ($alpha_quality < 0) ? 0 : (($alpha_quality > 100) ? 100 : $alpha_quality) .pass = ($pass < 0) ? 0 : (($pass > 10) ? 10 : $pass) .near_lossless = ($near_lossless < 0) ? 0 : (($near_lossless > 100) ? 100 : $near_lossless) EndWith Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPCreateAnim", _ "struct*", $tAnim, _ ;array of filenames with GDi+ supported images and delay per frame "uint", $iNumberOfFrames, _ ;amount of frames "wstr", $sOutfile, _ ;output filename "long", $loop_count, _ ;loop count -> 0 = endless "struct*", $tWebPConfig, _ ;WebP config settings "ptr", $pCallback)[0] ;callback pointer for progress status If $iReturn < 1 Then Return SetError(7, 0, $iReturn) ReDim $tArrayAnim[0] ReDim $tArrayFrameDelay[0] Return 1 EndFunc ;==>WebP_CreateWebPCreateAnim ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPCreateAnimFromScreenCapture ; Description ...: Capture the screen to WebP animation file ; Syntax ........: WebP_CreateWebPCreateAnimFromScreenCapture($x, $y, $w, $h, $sec, $sOutfile[, $fps = 30[, $CapCursor = 1[, ; $quality = 75.0[, $lossless = 0[, $method = 0[, $filter_strength = 60[, $sns_strength = 50[, $pass = 1[, ; $level = 6[, $filter_sharpness = 0[, $near_lossless = 100[, $alpha_compression = 0[, ; $alpha_filtering = 0[, $alpha_quality = 100[, $target_size = 0[, $loop_count = 0[, ; $WebPPreset = $WEBP_HINT_DEFAULT[, $pCallback = 0[, $sPath2DLL = ""]]]]]]]]]]]]]]]]]]]) ; Parameters ....: $x - x position on the screen where to start the capturing. ; $y - y position on the screen where to start the capturing. ; $w - width of the screen to capture. ; $h - height of the screen to capture. ; $sec - seconds to capture ; $sOutfile - filename of WebP animation output file. ; $fps - [optional] a floating point value. Default is 30 fps. ; $CapCursor - [optional] an unknown value. Default is 1. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $lossless - [optional] an unknown value. Default is 0. 0 for lossy encoding / 1 for lossless. ; $method - [optional] a map. Default is 0. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $pass - [optional] a pointer value. Default is 1. Number of entropy-analysis passes (in [1..10]). ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $near_lossless - [optional] a general number value. Default is 100. Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an array of unknowns. Default is 0. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 0. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. If non-zero, set the desired target size in bytes. ; $loop_count - [optional] an unknown value. Default is 0. 0 = endless. ; $WebPImageHint - [optional] an unknown value. Default is $WEBP_HINT_DEFAULT. ; $pCallback - [optional] a pointer value. Default is 0. Callback pointer for progress status ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 to -9 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPCreateAnimFromScreenCapture($x, $y, $w, $h, $sec, $sOutfile, $fps = 30, $CapCursor = 1, $quality = 75.0, $lossless = 0, $method = 0, $filter_strength = 60, $sns_strength = 50, _ $pass = 1, $filter_sharpness = 0, $near_lossless = 100, $alpha_compression = 0, $alpha_filtering = 0, $alpha_quality = 100, $target_size = 0, $loop_count = 0, _ $WebPImageHint = $WEBP_HINT_DEFAULT, $pCallback = 0, $sPath2DLL = "") If $w < 1 Or $h < 1 Or $fps < 1 Or $sec < 1 Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found $loop_count = $loop_count < 0 ? 0 : $loop_count Local $tWebPConfig = DllStructCreate($tagWebPConfig) FilltWebPConfigWithDefaults($tWebPConfig) With $tWebPConfig .lossless = $lossless .quality = ($quality < 0) ? 0 : (($quality > 100) ? 100 : $quality) .method = ($method < 0) ? 0 : (($method > 6) ? 6 : $method) .image_hint = ($WebPImageHint < 0) ? 0 : (($WebPImageHint > 4) ? 4 : $WebPImageHint) .target_size = $target_size ;in bytes .sns_strength = ($sns_strength < 0) ? 0 : (($sns_strength > 100) ? 100 : $sns_strength) .filter_strength = ($filter_strength < 0) ? 0 : (($filter_strength > 100) ? 100 : $filter_strength) .filter_sharpness = ($filter_sharpness < 0) ? 0 : (($filter_sharpness > 7) ? 7 : $filter_sharpness) .alpha_compression = $alpha_compression .alpha_filtering = ($alpha_filtering < 0) ? 0 : (($alpha_filtering > 2) ? 2 : $alpha_filtering) .alpha_quality = ($alpha_quality < 0) ? 0 : (($alpha_quality > 100) ? 100 : $alpha_quality) .pass = ($pass < 0) ? 0 : (($pass > 10) ? 10 : $pass) .near_lossless = ($near_lossless < 0) ? 0 : (($near_lossless > 100) ? 100 : $near_lossless) EndWith Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPCreateAnimFromScreenCapture", _ "long", $x, _ ;x position of the screen "long", $y, _ ;y position of the screen "ulong", $w, _ ;width of the screen to capture "ulong", $h, _ ;height of the screen to capture "long", $sec, _ ;duration in seconds "ushort", $fps, _ ;fps for capturing "wstr", $sOutfile, _ ;output file name "ubyte", $CapCursor, _ ;capture cursor "long", $loop_count, _ ;loop count -> 0 = endless. "struct*", $tWebPConfig, _ ;WebP config settings "ptr", $pCallback)[0] ;callback pointer for progress status If $iReturn < 1 Then Return SetError(3, 0, $iReturn) Return 1 EndFunc ;==>WebP_CreateWebPCreateAnimFromScreenCapture ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ConvertGIF2WebP ; Description ...: Converts a GIF animation to WebP animation ; Syntax ........: WebP_ConvertGIF2WebP($sGIFAnimFile, $sOutWebPFile[, $quality = 75.0[, $lossless = 1[, $method = 6[, ; $filter_strength = 60[, $sns_strength = 50[, $pass = 10[, $filter_sharpness = 0[, ; $near_lossless = 100[, $alpha_compression = 1[, $alpha_filtering = 1[, $alpha_quality = 100[, ; $target_size = 0[, $loop_count = 0[, $WebPPreset = $WEBP_HINT_DEFAULT[, $pCallback = 0[, ; $sPath2DLL = ""]]]]]]]]]]]]]]]]) ; Parameters ....: $sGIFAnimFile - a string value. ; $sOutWebPFile - a string value. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $lossless - [optional] an unknown value. Default is 1. 0 for lossy encoding / 1 for lossless. ; $method - [optional] a map. Default is 6. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $pass - [optional] a pointer value. Default is 10. Number of entropy-analysis passes (in [1..10]). ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $near_lossless - [optional] a general number value. Default is 100. Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an array of unknowns. Default is 1. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 1. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. If non-zero, set the desired target size in bytes. ; $loop_count - [optional] an unknown value. Default is 0. 0 = endless. ; $WebPPreset - [optional] an unknown value. Default is $WEBP_HINT_DEFAULT. ; $pCallback - [optional] a pointer value. Default is 0. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 on success, otherwise error -> -1 to -11 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ConvertGIF2WebP($sGIFAnimFile, $sOutWebPFile, $quality = 75.0, $lossless = 1, $method = 6, $filter_strength = 60, $sns_strength = 50, _ $pass = 10, $filter_sharpness = 0, $near_lossless = 100, $alpha_compression = 1, $alpha_filtering = 1, $alpha_quality = 100, _ $target_size = 0, $loop_count = 0, $WebPImageHint = $WEBP_HINT_DEFAULT, $pCallback = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If $sOutWebPFile = "" Then Return SetError(2, 0, 0) If StringRight($sOutWebPFile, 5) <> ".webp" Then $sOutWebPFile &= ".webp" $loop_count = $loop_count < 0 ? 0 : $loop_count Local $tWebPConfig = DllStructCreate($tagWebPConfig) FilltWebPConfigWithDefaults($tWebPConfig) With $tWebPConfig .lossless = $lossless .quality = ($quality < 0) ? 0 : (($quality > 100) ? 100 : $quality) .method = ($method < 0) ? 0 : (($method > 6) ? 6 : $method) .image_hint = ($WebPImageHint < 0) ? 0 : (($WebPImageHint > 4) ? 4 : $WebPImageHint) .target_size = $target_size ;in bytes .sns_strength = ($sns_strength < 0) ? 0 : (($sns_strength > 100) ? 100 : $sns_strength) .filter_strength = ($filter_strength < 0) ? 0 : (($filter_strength > 100) ? 100 : $filter_strength) .filter_sharpness = ($filter_sharpness < 0) ? 0 : (($filter_sharpness > 7) ? 7 : $filter_sharpness) .alpha_compression = $alpha_compression .alpha_filtering = ($alpha_filtering < 0) ? 0 : (($alpha_filtering > 2) ? 2 : $alpha_filtering) .alpha_quality = ($alpha_quality < 0) ? 0 : (($alpha_quality > 100) ? 100 : $alpha_quality) .pass = ($pass < 0) ? 0 : (($pass > 10) ? 10 : $pass) .near_lossless = ($near_lossless < 0) ? 0 : (($near_lossless > 100) ? 100 : $near_lossless) EndWith Local $iReturn = DllCall($sDLL, "long", "WebP_ConvertGIF2WebP", _ "wstr", $sGIFAnimFile, _ ;GIF animated input file "wstr", $sOutWebPFile, _ ;WebP animation output file "long", $loop_count, _ ;loop count -> 0 = endless "struct*", $tWebPConfig, _ ;WebP config settings "ptr", $pCallback)[0] ;callback pointer for progress status If $iReturn < 1 Then Return SetError(3, 0, $iReturn) Return 1 EndFunc ;==>WebP_ConvertGIF2WebP ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ConvertAPNG2WebP ; Description ...: Converts a PNG animation to WebP animation ; Syntax ........: WebP_ConvertAPNG2WebP($sAPNGAnimFile, $sOutWebPFile[, $quality = 75.0[, $lossless = 1[, $method = 5[, ; $filter_strength = 60[, $sns_strength = 50[, $pass = 10[, $filter_sharpness = 0[, ; $near_lossless = 100[, $alpha_compression = 1[, $alpha_filtering = 1[, $alpha_quality = 100[, ; $target_size = 0[, $loop_count = 0[, $WebPPreset = $WEBP_HINT_DEFAULT[, $iDefaultDelay = 50[, ; $pCallback = 0[, $sPath2DLL = ""]]]]]]]]]]]]]]]]]]) ; Parameters ....: $sAPNGAnimFile - a string value. ; $sOutWebPFile - a string value. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $lossless - [optional] an unknown value. Default is 1. 0 for lossy encoding / 1 for lossless. ; $method - [optional] a map. Default is 6. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $pass - [optional] a pointer value. Default is 10. Number of entropy-analysis passes (in [1..10]). ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $near_lossless - [optional] a general number value. Default is 100. Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an array of unknowns. Default is 1. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 1. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. If non-zero, set the desired target size in bytes. ; $loop_count - [optional] an unknown value. Default is 0. 0 = endless. ; $WebPPreset - [optional] an unknown value. Default is $WEBP_HINT_DEFAULT. ; $iDefaultDelay - [optional] an integer value. Default is 50. ; $pCallback - [optional] a pointer value. Default is 0. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 on success, otherwise error -> -1 to -13 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ConvertAPNG2WebP($sAPNGAnimFile, $sOutWebPFile, $quality = 75.0, $lossless = 1, $method = 6, $filter_strength = 60, $sns_strength = 50, _ $pass = 10, $filter_sharpness = 0, $near_lossless = 100, $alpha_compression = 1, $alpha_filtering = 1, $alpha_quality = 100, _ $target_size = 0, $loop_count = 0, $WebPImageHint = $WEBP_HINT_DEFAULT, $iDefaultDelay = 50, $pCallback = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If $sOutWebPFile = "" Then Return SetError(2, 0, 0) If StringRight($sOutWebPFile, 5) <> ".webp" Then $sOutWebPFile &= ".webp" $loop_count = $loop_count < 0 ? 0 : $loop_count Local $tWebPConfig = DllStructCreate($tagWebPConfig) FilltWebPConfigWithDefaults($tWebPConfig) With $tWebPConfig .lossless = $lossless .quality = ($quality < 0) ? 0 : (($quality > 100) ? 100 : $quality) .method = ($method < 0) ? 0 : (($method > 6) ? 6 : $method) .image_hint = ($WebPImageHint < 0) ? 0 : (($WebPImageHint > 4) ? 4 : $WebPImageHint) .target_size = $target_size ;in bytes .sns_strength = ($sns_strength < 0) ? 0 : (($sns_strength > 100) ? 100 : $sns_strength) .filter_strength = ($filter_strength < 0) ? 0 : (($filter_strength > 100) ? 100 : $filter_strength) .filter_sharpness = ($filter_sharpness < 0) ? 0 : (($filter_sharpness > 7) ? 7 : $filter_sharpness) .alpha_compression = $alpha_compression .alpha_filtering = ($alpha_filtering < 0) ? 0 : (($alpha_filtering > 2) ? 2 : $alpha_filtering) .alpha_quality = ($alpha_quality < 0) ? 0 : (($alpha_quality > 100) ? 100 : $alpha_quality) .pass = ($pass < 0) ? 0 : (($pass > 10) ? 10 : $pass) .thread_level = 1 .near_lossless = ($near_lossless < 0) ? 0 : (($near_lossless > 100) ? 100 : $near_lossless) EndWith $iDefaultDelay = ($iDefaultDelay < 0) ? 0 : $iDefaultDelay Local $iReturn = DllCall($sDLL, "long", "WebP_ConvertAPNG2WebP", _ "wstr", $sAPNGAnimFile, _ ;GIF animated input file "wstr", $sOutWebPFile, _ ;WebP animation output file "long", $loop_count, _ ;loop count -> 0 = endless "long", $iDefaultDelay, _ ;delay of each frame "struct*", $tWebPConfig, _ ;WebP config settings "ptr", $pCallback)[0] ;callback pointer for progress status If $iReturn < 1 Then Return SetError(3, 0, $iReturn) Return 1 EndFunc ;==>WebP_ConvertAPNG2WebP ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ReencodeAnimWebPImage ; Description ...: Re-encodes a WebP animated image ; Syntax ........: WebP_ReencodeAnimWebPImage($sFilename, $sOutfile, $tConfig[, $iNewWidth = 0[, $iNewHeight = 0[, ; $sPath2DLL = ""]]]) ; Parameters ....: $sFilename - a string value. ; $sOutfile - a string value. ; $tConfig - a dll struct value. ; $iNewWidth - [optional] an integer value. Default is 0. ; $iNewHeight - [optional] an integer value. Default is 0. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 on success, otherwise error -> -1 to -10 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ReencodeAnimWebPImage($sFilename, $sOutfile, $tConfig, $iNewWidth = 0, $iNewHeight = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) If Not IsDllStruct($tConfig) Then Return SetError(3, 0, 0) Local Const $iResult = DllCall($sDLL, "long", "WebP_ReencodeAnimWebPImage", "wstr", $sFilename, "wstr", $sOutfile, "struct*", $tConfig, "ushort", $iNewWidth, "ushort", $iNewHeight)[0] If $iResult < 1 Then Return SetError(4, 0, $iResult) Return $iResult EndFunc ;==>WebP_ReencodeAnimWebPImage ; #FUNCTION# ==============================================================================================================DllCallbackGetPtr($iCB)====== ; Name ..........: WebP_GetAnimFileInfo ; Description ...: Get information about a WebP anim file ; Syntax ........: WebP_GetAnimFileInfo($sFilename, Byref $tAnimInfo[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - path to webp anim file. ; $tAnimInfo - [in/out] a dll struct value. Must be "ulong Width;ulong Height;ulong FrameCount;ulong Duration;double FPS" ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 to -6 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_GetAnimFileInfo($sFilename, ByRef $tAnimInfo, $sPath2DLL = "") If Not FileExists($sFilename) Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_GetAnimFileInfo", "wstr", $sFilename, "struct*", $tAnimInfo)[0] If @error Or $iReturn < 1 Then SetError(3, 0, $iReturn) Return $iReturn EndFunc ;==>WebP_GetAnimFileInfo ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_GetImagesDiffFromFile ; Description ...: Displays the difference of two WebP images. ; Syntax ........: WebP_GetImagesDiffFromFile($sFilename1, $sFilename2[, $iMetricType = 1[, $sPath2DLL = ""]]) ; Parameters ....: $sFilename1 - a string value. First WebP image filename. ; $sFilename2 - a string value. Second WebP image filename. ; $iMetricType - [optional] an integer value. Default is 1. Valid values 0 - 2. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: array with distortion values, otherwise error ; Author ........: UEZ ; Modified ......: ; Remarks .......: Possible metric type: ; 0: PSNR - Peak signal-to-noise ratio - measures numerical deviation (higher = better). ; Value range Interpretation ; > 50 dB Excellent quality - barely visible ; 40-50 dB Very good quality ; 30-40 dB Good to medium quality ; < 30 dB Clearly visible losses ; 1: SSIM - Structural Similarity Index - takes visual perception into account (0 - 100, closer to 100 = better). ; Value range Interpretation ; 95 - 100 Almost identical / perfect quality ; 90 - 95 Very good quality ; 85 - 90 Good quality ; < 85 Visible structural differences ; 2: LSIM - Local Similarity - more detailed, for local differences (more experimental). Same as SSIM. ; ; Both images must have same dimension! ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_GetImagesDiffFromFile($sFilename1, $sFilename2, $iMetricType = 1, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename1) Then Return SetError(2, 0, 0) If Not FileExists($sFilename2) Then Return SetError(3, 0, 0) $iMetricType = ($iMetricType > 2) ? 2 : ($iMetricType < 0 ? 0 : $iMetricType) Local $tDistortion = DllStructCreate("float d[5]") Local $iReturn = DllCall($sDLL, "long", "WebP_GetImagesDiffFromFile", "wstr", $sFilename1, "wstr", $sFilename2, "long", $iMetricType, "ptr*", DllStructGetPtr($tDistortion))[0] If $iReturn < 1 Then SetError(4, 0, $iReturn) Local $aDistortion[5] = [$tDistortion.d((1)), $tDistortion.d((2)), $tDistortion.d((3)), $tDistortion.d((4)), $tDistortion.d((5))] Return $aDistortion EndFunc ;==>WebP_GetImagesDiffFromFile ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_ScaleImage ; Description ...: Resizes a WebP image. ; Syntax ........: WebP_ScaleImage($sSourceFile, $iW, $iH, $sDestFile[, $sPath2DLL = ""]) ; Parameters ....: $sSourceFile - source WebP file to load. ; $iW - an integer value. ; $iH - an integer value. ; $sDestFile - destination WebP file to save. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 to -9 ; Author ........: UEZ ; Modified ......: ; Remarks .......: Resized image will be saved lossless. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_ScaleImage($sSourceFile, $iW, $iH, $sDestFile, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_ScaleImage", "wstr", $sSourceFile, "long", $iW, "long", $iH, "wstr", $sDestFile)[0] If $iReturn < 1 Then SetError(2, 0, $iReturn) Return 1 EndFunc ;==>WebP_ScaleImage ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_GetImageQuality ; Description ...: Estimates the quality of a WebP image. ; Syntax ........: WebP_GetImageQuality($sFilename[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - source WebP file to load. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: the quality of the WebP image. 0 - 100 for lossy - 101 for lossless. 0 or negative value on error. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_GetImageQuality($sFilename, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) Local $iReturn = DllCall($sDLL, "long", "WebP_GetImageQuality", "wstr", $sFilename)[0] If $iReturn < 0 Then SetError(3, 0, $iReturn) Return $iReturn EndFunc ;==>WebP_GetImageQuality ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_PlayAnimFile ; Description ...: Plays an animated WebP file and display it in the GUI ; Syntax ........: WebP_PlayAnimFile($sFilename, $hGUI[, $w = 0[, $h = 0[, $pCallback = 0[, $sPath2DLL = ""]]]]) ; Parameters ....: $sFilename - path to webp anim file. ; $hGUI - the handle to the GUI to copy the frames to it. ; $w - [optional] an unknown value. Default is 0. If 0 the width from the animation file will be used. ; $h - [optional] a handle value. Default is 0. If 0 the height from the animation file will be used. ; $pCallback - [optional] a pointer value. Default is 0. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: a pointer to the thread on success, otherwise error -> 0 ; Author ........: UEZ ; Modified ......: ; Remarks .......: Don't use $pCallback yet because it is not working properly! Don't forget DllClose($g_hDLL) when done! DllOpen must be used otherwise crash. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_PlayAnimFile($sFilename, $hGUI, $w = 0, $h = 0, $pCallback = 0, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) $g_hDLL = DllOpen($sDLL) Local $pReturn = DllCall($g_hDLL, "ptr", "WebP_PlayAnimFile", "wstr", $sFilename, "hwnd", HWnd($hGUI), "ulong", $w, "ulong", $h, "ptr", $pCallback)[0] If $pReturn = 0 Then SetError(3, 0, 0) Return $pReturn EndFunc ;==>WebP_PlayAnimFile ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_StopAnimFile ; Description ...: Stops the animation which was started by WebP_PlayAnimFile() function. ; Syntax ........: WebP_StopAnimFile($pThread[, $sPath2DLL = ""]) ; Parameters ....: $pThread - a thread parameter pointer ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 1 on success, otherwise error -> -1 ; Author ........: UEZ ; Modified ......: ; Remarks .......: You must call WebP_PlayAnimFile() before you call WebP_StopAnimFile()! Don't forget DllClose($g_hDLL) when done! ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_StopAnimFile($pThread, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not $g_hDLL Then Return SetError(2, 0, 0) Local $iReturn = DllCall($g_hDLL, "long", "WebP_StopAnimFile", "ptr", $pThread)[0] If $iReturn < 1 Then SetError(3, 0, $iReturn) Return $iReturn EndFunc ;==>WebP_StopAnimFile ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_MarkScreenRegion ; Description ...: Selected area on desktop will be captured and save to clipbord or GDI bitmap handle will be returned. ; Syntax ........: _WinAPI_MarkScreenRegion([$iFillMode = 0]) ; Parameters ....: $iFillMode - [optional] an integer value. Default is 0. ; 0: marked area filled with solid color ; 1: marked area filled with hatch pattern ($HS_DIAGCROSS) ; 2: marked area without any fill pattern / color - only red border ; Return values .: 0 / 1 / -1 / array with coordinates [x, y, w, h] ; Author ........: UEZ ; Version .......: 0.90 build 2025-06-27 ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: no ; =============================================================================================================================== Func _WinAPI_MarkScreenRegion($iFillMode = 0) If @OSBuild > 6299 Then ;https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx DllCall("Shcore.dll", "long", "PROCESS_DPI_AWARENESS", 1) ;PROCESS_SYSTEM_DPI_AWARE = 1 (https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx) Else DllCall("User32.dll", "bool", "SetProcessDPIAware") EndIf Local $iOld = AutoItSetOption("MouseCoordMode", 1) Local Const $hDesktop = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hDesktop) ;should work also on multi screens Local Const $iW = $aFullScreen[2], $iH = $aFullScreen[3] Local Const $hGUI_MarkScreen = GUICreate("", $iW, $iH, $aFullScreen[0], $aFullScreen[1], $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetState(@SW_SHOW, $hGUI_MarkScreen) Local Const $hDC = _WinAPI_GetDC($hGUI_MarkScreen) Local Const $hGfxDC = _WinAPI_CreateCompatibleDC($hDC) Local Const $hBitmapGDI = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local $hObjOld = _WinAPI_SelectObject($hGfxDC, $hBitmapGDI) Local $tSize = DllStructCreate($tagSIZE) $tSize.x = $iW $tSize.y = $iH Local $tSource = DllStructCreate($tagPOINT) Local $tBlend = DllStructCreate($tagBLENDFUNCTION) $tBlend.Alpha = 0xFF $tBlend.Format = 1 Local $tDest = DllStructCreate($tagPOINT), $pPoint = DllStructGetPtr($tDest) $tDest.x = $aFullScreen[0] $tDest.y = $aFullScreen[1] Local Const $hPen = _WinAPI_CreatePen($PS_SOLID, 1, 0x0000FF) Local Const $hPen_Orig = _WinAPI_SelectObject($hGfxDC, $hPen) Local $hBrush, $iAlpha2, $iFlag $iFillMode = $iFillMode > 2 ? 2 : $iFillMode < 0 ? 0 : $iFillMode Switch $iFillMode Case 0 $hBrush = _WinAPI_CreateBrushIndirect($BS_SOLID, 0x808080) $iAlpha2 = 0xA0 $iFlag = $ULW_ALPHA Case 1 $hBrush = _WinAPI_CreateBrushIndirect($BS_HATCHED, 0x808000, $HS_DIAGCROSS) $iAlpha2 = 0x30 $iFlag = $ULW_ALPHA Case 2 $hBrush = _WinAPI_CreateBrushIndirect($BS_HOLLOW, 0x000000) $iAlpha2 = 0xFF ;not needed $iFlag = $ULW_COLORKEY EndSwitch Local $hBrush_Orig = _WinAPI_SelectObject($hGfxDC, $hBrush) Local $aMPos[5], $aMPos_old[4], $tRECT = _WinAPI_CreateRect(0, 0, 0, 0) Do GUISetCursor(16, 1, $hGUI_MarkScreen) $aMPos = GUIGetCursorInfo($hGUI_MarkScreen) $aMPos_old[0] = $aMPos[0] $aMPos_old[1] = $aMPos[1] $aMPos_old[2] = MouseGetPos(0) $aMPos_old[3] = MouseGetPos(1) Switch $aMPos[2] Case 0 ;display crosshair _WinAPI_BitBlt($hGfxDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $CAPTUREBLT) _WinAPI_DrawLine($hGfxDC, $tDest.x, $aMPos[1], $iW, $aMPos[1]) _WinAPI_DrawLine($hGfxDC, $aMPos[0], $tDest.y, $aMPos[0], $iH) _WinAPI_UpdateLayeredWindow($hGUI_MarkScreen, $hDC, $tDest, $tSize, $hGfxDC, $tSource, 0, $tBlend, $ULW_COLORKEY) Case 1 ; $tBlend.Alpha = $iAlpha2 While $aMPos[2] ;mark region GUISetCursor(14, 1, $hGUI_MarkScreen) ;WinGetHandle(AutoItWinGetTitle())) $aMPos = GUIGetCursorInfo($hGUI_MarkScreen) _WinAPI_BitBlt($hGfxDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $CAPTUREBLT) ;clear bitmap ;draw rectangle $tRECT.Left = $aMPos_old[0] $tRECT.Top = $aMPos_old[1] $tRECT.Right = $aMPos[0] $tRECT.Bottom = $aMPos[1] _WinAPI_Rectangle($hGfxDC, $tRECT) If $iFillMode <> 2 Then _WinAPI_InvertRect($hGfxDC, $tRECT) _WinAPI_UpdateLayeredWindow($hGUI_MarkScreen, $hDC, $tDest, $tSize, $hGfxDC, $tSource, 0, $tBlend, $iFlag) Sleep(10) WEnd _WinAPI_SelectObject($hGfxDC, $hObjOld) _WinAPI_ReleaseDC($hGUI_MarkScreen, $hDC) _WinAPI_DeleteDC($hGfxDC) _WinAPI_DeleteObject($hBitmapGDI) _WinAPI_SelectObject($hGfxDC, $hPen_Orig) _WinAPI_DeleteObject($hPen) _WinAPI_SelectObject($hGfxDC, $hBrush_Orig) _WinAPI_DeleteObject($hBrush) GUIDelete($hGUI_MarkScreen) AutoItSetOption("MouseCoordMode", $iOld) Local $aCoords[4] = [($aMPos[0] > $aMPos_old[2] ? $aMPos_old[2] : $aMPos[0]), ($aMPos[1] > $aMPos_old[3] ? $aMPos_old[3] : $aMPos[1]), Abs($tRECT.Right - $tRECT.Left) + 1, Abs($tRECT.Bottom - $tRECT.Top) + 1] Return $aCoords EndSwitch Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _WinAPI_SelectObject($hGfxDC, $hObjOld) _WinAPI_ReleaseDC($hGUI_MarkScreen, $hDC) _WinAPI_DeleteDC($hGfxDC) _WinAPI_DeleteObject($hBitmapGDI) _WinAPI_SelectObject($hGfxDC, $hPen_Orig) _WinAPI_DeleteObject($hPen) GUIDelete($hGUI_MarkScreen) AutoItSetOption("MouseCoordMode", $iOld) Return -1 EndSwitch Until False EndFunc ;==>_WinAPI_MarkScreenRegion ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: Path2DLL ; Description ...: Return the path to the _WebP_x??.dll ; Author ........: UEZ ; Modified.......: ; Remarks .......: This function is used internally by WebP.au3 ; =============================================================================================================================== Func Path2DLL($sPath2DLL = "") Return $sPath2DLL ? $sPath2DLL : @ScriptDir & (@AutoItX64 ? "\_WebP_x64.dll" : "\_WebP_x86.dll") EndFunc ;==>Path2DLL ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: FilltWebPConfigWithDefaults ; Description ...: Set the default $tWebPConfig struct parameters ; Author ........: UEZ ; Modified.......: ; Remarks .......: This function is used internally by WebP.au3 ; =============================================================================================================================== Func FilltWebPConfigWithDefaults(ByRef $tWebPConfig) With $tWebPConfig .lossless = 0 .quality = 75 .method = 4 .image_hint = 0 .target_size = 0 .target_PSNR = 0 .segments = 4 .sns_strength = 50 .filter_strength = 60 .filter_sharpness = 0 .filter_type = 1 .autofilter = 0 .alpha_compression = 1 .alpha_filtering = 1 .alpha_quality = 100 .pass = 1 .show_compressed = 0 .preprocessing = 0 .partitions = 0 .partition_limit = 0 .emulate_jpeg_size = 0 .thread_level = 0 .low_memory = 0 .near_lossless = 100 .exact = 0 .use_delta_palette = 0 .use_sharp_yuv = 0 .qmin = 0 .qmax = 100 EndWith EndFunc ;==>FilltWebPConfigWithDefaults WebP Advanced Encoder GUI: ;Coded by UEZ build 2025-08-06 #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_HiDpi=n #AutoIt3Wrapper_Version=p #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe ;/rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #pragma compile(Icon, WebP_logo_2010_by_Simo99.ico) #pragma compile(FileVersion, 0.9.9.1) #pragma compile(ProductVersion, 3.3.16.1) #pragma compile(CompanyName, "UEZ Software Development") #pragma compile(ProductName, "WebP Advanced Encoder GUI") AutoItSetOption("MustDeclareVars", 1) #include <Array.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiMenu.au3> #include <GuiStatusBar.au3> #include <Memory.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WinAPISysWin.au3> #include <WinAPITheme.au3> #include <WindowsConstants.au3> #include "WebP.au3" Break(0) If @OSBuild < 10240 Then MsgBox($MB_ICONWARNING, "Warning", "Your Windows version is not support!", 30) If WebP_Ver2() < "0.4.3" Then Exit MsgBox($MB_ICONERROR, "ERROR", "DLL Version v0.4.3+ required!", 30) Global Const $ver = "v0.99.1", $build = "build 2025-08-06" #Region TichySID Global Const $tagIMAGE_DOS_HEADER = 'WORD e_magic;WORD e_cblp;WORD e_cp;WORD e_crlc;WORD e_cparhdr;WORD e_minalloc;WORD e_maxalloc;WORD e_ss;WORD e_sp;WORD e_csum;WORD e_ip;WORD e_cs;WORD e_lfarlc;WORD e_ovno;WORD e_res[4];WORD e_oemid;WORD e_oeminfo;WORD e_res2[10];LONG e_lfanew;' Global Const $tagIMAGE_FILE_HEADER = 'WORD Machine;WORD NumberOfSections;DWORD TimeDateStamp;DWORD PointerToSymbolTable;DWORD NumberOfSymbols;WORD SizeOfOptionalHeader;WORD Characteristics;' Global $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;DWORD BaseOfData;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' If @AutoItX64 Then $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' Global Const $tagIMAGE_NT_HEADER = 'DWORD Signature;' & $tagIMAGE_FILE_HEADER & $tagIMAGE_OPTIONAL_HEADER Global Const $tagIMAGE_SECTION_HEADER = 'CHAR Name[8];DWORD VirtualSize;DWORD VirtualAddress;DWORD SizeOfRawData;DWORD PointerToRawData;DWORD PointerToRelocations;DWORD PointerToLinenumbers;WORD NumberOfRelocations;WORD NumberOfLinenumbers;DWORD Characteristics;' Global Const $tagIMAGE_DATA_DIRECTORY = 'DWORD VirtualAddress;DWORD Size;' Global Const $tagIMAGE_BASE_RELOCATION = 'DWORD VirtualAddress;DWORD SizeOfBlock;' Global Const $tagIMAGE_IMPORT_DESCRIPTOR = 'DWORD OriginalFirstThunk;DWORD TimeDateStamp;DWORD ForwarderChain;DWORD Name;DWORD FirstThunk;' Global Const $tagIMAGE_IMPORT_BY_NAME = 'WORD Hint;char Name[1];' Global Const $tagIMAGE_EXPORT_DIRECTORY = 'DWORD Characteristics;DWORD TimeDateStamp;WORD MajorVersion;WORD MinorVersion;DWORD Name;DWORD Base;DWORD NumberOfFunctions;DWORD NumberOfNames;DWORD AddressOfFunctions;DWORD AddressOfNames;DWORD AddressOfNameOrdinals;' Global $_KERNEL32DLL = DllOpen('kernel32.dll') Global $_MFHookPtr, $_MFHookBak, $_MFHookApi = 'LocalCompact' Global Const $tagModule = 'PTR ExportList;PTR CodeBase;PTR ImportList;PTR DllEntry;DWORD Initialized;' Global Const $SID_MEMORY = 1 Global Const $SID_NON_DEFAULT = 2 Global $hTitchysidDll, $iSubsongCount = 0 #EndRegion ; enum _PROCESS_DPI_AWARENESS -> https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx Global Enum $DPI_AWARENESS_INVALID = -1, $PROCESS_DPI_UNAWARE = 0, $PROCESS_SYSTEM_DPI_AWARE, $PROCESS_PER_MONITOR_DPI_AWARE ;https://docs.microsoft.com/en-us/windows/desktop/hidpi/dpi-awareness-context Global Enum $Context_UnawareGdiScaled = -5, $Context_PerMonitorAwareV2, $Context_PerMonitorAware, $Context_SystemAware, $Context_Unaware ; enum _MONITOR_DPI_TYPE Global Enum $MDT_EFFECTIVE_DPI = 0, $MDT_ANGULAR_DPI, $MDT_RAW_DPI Global Const $MDT_DEFAULT = $MDT_EFFECTIVE_DPI Global Const $SM_CXPADDEDBORDER = 92 _GDIPlus_Startup() ;~ Global $aDPI = _WinAPI_GetDpiForMonitor() ;_GDIPlus_GraphicsGetDPIRatio() Global $aDPI = [1, 1] Global $hGUI_About, $iFPS = 0, $iShowFPS = 0, $bExit, $bGUIBgColor = 0xFF808080 #Region GUI Global Const $SC_DRAGMOVE = 0xF012, $iW = 322, $iH = 694 Global Const $hGUI = GUICreate("WAE GUI " & $ver & " Beta by UEZ", $iW, $iH, @DesktopWidth - $iW - 8, -1, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_APPWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) GUISetFont(10 * $aDPI[0], 400, 0, "Arial Narrow") Global Const $Title = GUICtrlCreateLabel("WebP Advanced Encoder GUI", 5, 8, 310, 41) GUICtrlSetFont(-1, 21 * $aDPI[0], 400, 0, "Arial Narrow") Global Const $icLoad = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -127, 8, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Load a GDI+ supported image") Global Const $icSave = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -259, 56, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Save compressed image in WebP format.") Global Const $icReset = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -239, 104, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Reset image position if image was moved (only for images larger than preview window).") GUICtrlCreateLabel("", 0, 106, $iW - 2, 2, $SS_ETCHEDHORZ) Global Const $lbPresets = GUICtrlCreateLabel("Presets", 10, 125, 39, 20) Global Const $cbPreset = GUICtrlCreateCombo("Default", 120, 120, $iW - 177, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)), $hcbPreset = GUICtrlGetHandle($cbPreset) GUICtrlSetData(-1, "Picture|Photo|Graph|Last") Global Const $chkbLossless = GUICtrlCreateCheckbox("&Lossless", 120, 152, 97, 17) GUICtrlSetTip(-1, "Enable lossless compression. Default: lossy.") Global Const $lbEncoding = GUICtrlCreateLabel("Encoding", 10, 152, 48, 20) Global Const $lbQuality = GUICtrlCreateLabel("Quality", 10, 176, 36, 20) Global Const $slQuality = GUICtrlCreateSlider(116, 176, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslQuality = GUICtrlGetHandle($slQuality) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 75) GUICtrlSetTip(-1, "Between 0 and 100. 0 gives the smallest size and 100 the largest.") Global Const $ipQuality = GUICtrlCreateInput("", $iW - 48, 172, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slQuality)) Global Const $lbMethod = GUICtrlCreateLabel("Method", 10, 210, 39, 20) Global Const $slMethod = GUICtrlCreateSlider(116, 210, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslMethod = GUICtrlGetHandle($slMethod) GUICtrlSetLimit(-1, 6, 0) GUICtrlSetData(-1, 4) GUICtrlSetTip(-1, "Quality/speed trade-off (0=fast, 6=slower-better.") Global Const $ipMethod = GUICtrlCreateInput("", $iW - 48, 206, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slMethod)) Global Const $lbSNS_Strength = GUICtrlCreateLabel("SNS-Strength", 10, 242, 66, 20) Global Const $slSNS_Strength = GUICtrlCreateSlider(116, 244, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslSNS_Strength = GUICtrlGetHandle($slSNS_Strength) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 50) GUICtrlSetTip(-1, "Spatial Noise Shaping. 0=off, 100=maximum.") Global Const $ipSSN_Strength = GUICtrlCreateInput("", $iW - 48, 240, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slSNS_Strength)) Global Const $lbFilterSharpness = GUICtrlCreateLabel("Filter Sharpness", 10, $iW - 48, 81, 20) Global Const $slFilter_Sharpness = GUICtrlCreateSlider(116, 278, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslFilter_Sharpness = GUICtrlGetHandle($slFilter_Sharpness) GUICtrlSetLimit(-1, 7, 0) GUICtrlSetTip(-1, "Range: [0 = off .. 7 = least sharp].") Global Const $ipFilter_Sharpness = GUICtrlCreateInput("", $iW - 48, 274, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slFilter_Sharpness)) Global Const $lbFilter_Strength = GUICtrlCreateLabel("Filter Strenght", 010, 304, 69, 20) Global Const $slFilter_Strength = GUICtrlCreateSlider(116, 312, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslFilter_Strength = GUICtrlGetHandle($slFilter_Strength) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 60) GUICtrlSetTip(-1, "Range: [0 = off .. 100 = strongest]") Global Const $ipFilter_Strength = GUICtrlCreateInput("", $iW - 48, 308, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slFilter_Strength)) Global Const $lbPass = GUICtrlCreateLabel("Pass", 10, 344, 27, 20) Global Const $slPass = GUICtrlCreateSlider(116, 346, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslPass = GUICtrlGetHandle($slPass) GUICtrlSetLimit(-1, 10, 1) GUICtrlSetData(-1, 1) GUICtrlSetTip(-1, "Number of entropy-analysis passes (in [1..10]).") Global Const $ipPass = GUICtrlCreateInput("", $iW - 48, 342, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slPass)) Global Const $lbNear_Lossless = GUICtrlCreateLabel("Near Lossless", 10, 378, 80, 20) Global Const $slNear_Lossless = GUICtrlCreateSlider(116, 380, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslNear_Lossless = GUICtrlGetHandle($slNear_Lossless) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 100) GUICtrlSetTip(-1, "Specify the level of near-lossless image preprocessing. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default).") Global Const $ipNear_Lossless = GUICtrlCreateInput("", $iW - 48, 374, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slNear_Lossless)) Global Const $lbLevel = GUICtrlCreateLabel("Level", 10, 411, 30, 20) Global Const $slLevel = GUICtrlCreateSlider(116, 414, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslLevel = GUICtrlGetHandle($slLevel) GUICtrlSetLimit(-1, 9, 0) GUICtrlSetData(-1, 6) GUICtrlSetTip(-1, "Switch on lossless compression mode with the specified level between 0 and 9, with level 0 being the fastest, 9 being the slowest.") GUICtrlSetState(-1, $GUI_DISABLE) Global Const $ipLevel = GUICtrlCreateInput("", $iW - 48, 410, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slLevel)) Global Const $lbAlpha_Compression = GUICtrlCreateLabel("Alpha Compression", 10, 444, 96, 20) Global Const $chkbAlpha_Compression = GUICtrlCreateCheckbox("&Enable", 120, 444, 97, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global Const $lbAlpha_Filtering = GUICtrlCreateLabel("Alpha Filtering", 10, 478, 71, 20) Global Const $slAlpha_Filtering = GUICtrlCreateSlider(114, 482, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslAlpha_Filtering = GUICtrlGetHandle($slAlpha_Filtering) GUICtrlSetLimit(-1, 2, 0) GUICtrlSetData(-1, 1) GUICtrlSetTip(-1, "Predictive filtering method for alpha plane. 0: none, 1: fast, 2: best. Default if 1.") Global Const $ipAlpha_Filtering = GUICtrlCreateInput("", $iW - 48, 478, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slAlpha_Filtering)) Global Const $lbAlpha_Quality = GUICtrlCreateLabel("Alpha Quality", 8, 516, 66, 20) Global Const $slAlpha_Quality = GUICtrlCreateSlider(114, 516, $iW - 164, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslAlpha_Quality = GUICtrlGetHandle($slAlpha_Quality) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 100) GUICtrlSetTip(-1, "Between 0 (smallest size) and 100 (lossless).") Global Const $ipAlpha_Quality = GUICtrlCreateInput("", $iW - 48, 512, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slAlpha_Quality)) Global Const $lbTarget_Size = GUICtrlCreateLabel("Target Size", 10, 552, 58, 20) Global Const $ipTarget_Size = GUICtrlCreateInput("0", 120, 550, $iW - 177, 24, $ES_NUMBER) GUICtrlSetTip(-1, "If non-zero, set the desired target size in bytes (lossy mode only!).") Global Const $chkbCountColors = GUICtrlCreateCheckbox("&Count Colors", 10, 590, 87, 17) Global Const $lbColorOriginal = GUICtrlCreateLabel("Source:", 101, 590, 38, 20) Global Const $ipColorOriginal = GUICtrlCreateInput("0", 142, 588, 60, 24, BitOR($ES_NUMBER, $ES_READONLY)) Global Const $lbColorWebP = GUICtrlCreateLabel("WebP:", 215, 590, 32, 20) Global Const $ipColorWebP = GUICtrlCreateInput("0", 250, 588, 60, 24, BitOR($ES_NUMBER, $ES_READONLY)) Global Const $btnShow = GUICtrlCreateButton("Show Original Image", 10, 630, 123, 25) GUICtrlSetTip(-1, "Press lmb and hold it to display original image.") Global Const $btnApply = GUICtrlCreateButton("&Apply Settings", 188, 630, 123, 25) Global Const $StatusBar = _GUICtrlStatusBar_Create($hGUI), $iSBColor = 0xE9CFEC _WinAPI_SetWindowTheme($StatusBar, "", "") _GUICtrlStatusBar_SetText($StatusBar, " Welcome to 'WebP Advanced Encoder GUI' ٩(●̮̮̃•̃)۶") _GUICtrlStatusBar_SetBkColor($StatusBar, $iSBColor) Global Const $hGUI_Image = GUICreate("", 0, 0, -1, -1, $WS_EX_TOOLWINDOW, BitOR($WS_EX_TOOLWINDOW, $WS_EX_APPWINDOW)) GUISetBkColor(BitAND(0xFFFFFF, $bGUIBgColor), $hGUI_Image) Global Const $iPic_WebP = GUICtrlCreatePic("", 0, 0, 0, 0), $hPic_WebP = GUICtrlGetHandle($iPic_WebP) ;~ Global Const $iW_Zoom = @DesktopWidth * 0.25, $iH_Zoom = @DesktopHeight * 0.25 ;~ Global Const $hGUI_Image_Zoom = GUICreate("", $iW_Zoom, $iH_Zoom, 0, 0, $WS_POPUP) Global Const $dw = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME), $dh = _WinAPI_GetSystemMetrics($SM_CYDLGFRAME) + _WinAPI_GetSystemMetrics($SM_CYSIZE) + 1 Global Enum $idAbout = 5000, $idResetPicPos, $idResetValues Global Const $hMenu_Sys = _GUICtrlMenu_GetSystemMenu($hGUI) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_STRING, $idAbout, "About") Global Const $hImage_Icon = _GDIPlus_BitmapCreateFromMemory(_WebP_Icon()) Global Const $hIcon = _GDIPlus_HICONCreateFromBitmap($hImage_Icon) _WinAPI_SetClassLongEx($hGUI, -34, $hIcon) _GDIPlus_ImageDispose($hImage_Icon) GUISetState(@SW_HIDE, $hGUI_Image) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetState(@SW_SHOW, $hGUI_Image_Zoom) _WinAPI_SetProcessDpiAwarenessContext($Context_PerMonitorAwareV2, $hGUI, 2) Global Const $iDummy_About = GUICtrlCreateDummy(), $iDummy_Return = GUICtrlCreateDummy() Global $sFileLoad, $hImage, $hImage_GDI, $hHBitmap, $aDim, $aPixelFormat, $pMemData, $pMemData_Size, $tMem, $mp, $sFileSave, $hFile, $nBytes, $nBytes, $iResetPosX, $iResetPosY, _ $hImage_tmp GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") GUIRegisterMsg($WM_LBUTTONDOWN, "WM_LBUTTONDOWN") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") #EndRegion GUI Global $aGUIGetMsg, $aMPos1, $aMPos2, $iMPx, $iMPy, $iMPx_p = 0, $iMPy_p = 0, $bBigger = False, $iResult, $old_cursor, $bNew = False While 1 $mp = GUIGetCursorInfo($hGUI) If $hImage And $mp[2] And $mp[4] = $btnShow Then _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hImage_GDI)) While $mp[2] $mp = GUIGetCursorInfo($hGUI) Sleep(10) WEnd _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) EndIf $mp = GUIGetCursorInfo($hGUI_Image) $aMPos1 = MouseGetPos() If $mp[4] = $iPic_WebP And $mp[2] And $bBigger And WinActive($hGUI_Image) Then While $mp[2] $mp = GUIGetCursorInfo($hGUI_Image) Sleep(10) $aMPos2 = MouseGetPos() $iMPx = $iMPx_p + $aMPos2[0] - $aMPos1[0] $iMPy = $iMPy_p + $aMPos2[1] - $aMPos1[1] ControlMove($hGUI_Image, "", $iPic_WebP, $iMPx, $iMPy) WEnd $iMPx_p = $iMPx $iMPy_p = $iMPy EndIf $aGUIGetMsg = GUIGetMsg(1) Switch $aGUIGetMsg[1] Case $hGUI Switch $aGUIGetMsg[0] Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_DROPFILES, "") GUIRegisterMsg($WM_LBUTTONDOWN, "") GUIRegisterMsg($WM_COMMAND, "") GUIRegisterMsg($WM_CONTEXTMENU, "") GUIRegisterMsg($WM_SYSCOMMAND, "") GUIRegisterMsg($WM_HSCROLL, "") ;~ If IsDllStruct($tMem) Then WebP_FreeUp($tMem) _WinAPI_DestroyIcon($hIcon) If $hImage_tmp Then _GDIPlus_ImageDispose($hImage_tmp) If $hImage Then _GDIPlus_ImageDispose($hImage) If $hHBitmap Then _WinAPI_DeleteObject($hHBitmap) If $hImage_GDI Then _WinAPI_DeleteObject($hImage_GDI) If $hGUI_Image Then GUIDelete($hGUI_Image) _GDIPlus_Shutdown() GUIDelete($hGUI_Image) GUIDelete($hGUI) DllClose($_KERNEL32DLL) Exit Case $btnApply, $iDummy_Return If $hImage Then CompressAndDisplay($hImage) EndIf Case $icLoad $sFileLoad = FileOpenDialog("Select an image to compress", "", "Images (*.jpg;*.bmp;*.png;*.gif;*.tif;*webp)") If @error Then ContinueLoop LoadImage($sFileLoad) Case $icSave If $hImage Then $sFileSave = FileSaveDialog("Save WebP Image", "", "WebP Image (*.webp)", BitOR($FD_PATHMUSTEXIST, $FD_PROMPTOVERWRITE), StringRegExpReplace($sFileLoad, ".+\\(.+)\..*", "$1") & ".webp", $hGUI) If @error Then ContinueLoop $hFile = _WinAPI_CreateFile($sFileSave, 1) $iResult = _WinAPI_WriteFile($hFile, $tMem.pMemData, $tMem.memsize, $nBytes) _WinAPI_CloseHandle($hFile) If Not $iResult Then MsgBox($MB_ICONERROR, "ERROR", "Unable to save WebP image to disk!", 30, $hGUI) Else MsgBox($MB_ICONINFORMATION, "Information", "WebP image successfully save to disk", 10, $hGUI) EndIf EndIf Case $icReset ResetImage() Case $slAlpha_Filtering GUICtrlSetData($ipAlpha_Filtering, GUICtrlRead($slAlpha_Filtering)) Case $slAlpha_Quality GUICtrlSetData($ipAlpha_Quality, GUICtrlRead($slAlpha_Quality)) Case $slFilter_Sharpness GUICtrlSetData($ipFilter_Sharpness, GUICtrlRead($slFilter_Sharpness)) Case $slFilter_Strength GUICtrlSetData($ipFilter_Strength, GUICtrlRead($slFilter_Strength)) Case $slLevel GUICtrlSetData($ipLevel, GUICtrlRead($slLevel)) Case $slMethod GUICtrlSetData($ipMethod, GUICtrlRead($slMethod)) Case $slNear_Lossless GUICtrlSetData($ipNear_Lossless, GUICtrlRead($slNear_Lossless)) Case $slPass GUICtrlSetData($ipPass, GUICtrlRead($slPass)) Case $slQuality GUICtrlSetData($ipQuality, GUICtrlRead($slQuality)) Case $slSNS_Strength GUICtrlSetData($ipSSN_Strength, GUICtrlRead($slSNS_Strength)) Case $iDummy_About AutoItSetOption("GUIOnEventMode", 1) GDIPlus_About(11 * $aDPI[0], -12, 24.5) AutoItSetOption("GUIOnEventMode", 0) Case $btnShow If BitAND(WinGetState($hGUI_Image), $WIN_STATE_VISIBLE) = $WIN_STATE_VISIBLE Then WinActivate($hGUI_Image) EndSwitch Case $hGUI_Image Switch $aGUIGetMsg[0] Case $GUI_EVENT_CLOSE EndSwitch EndSwitch WEnd Func ResetImage() If $bBigger Then $iMPx_p = $iResetPosX $iMPy_p = $iResetPosY ControlMove($hGUI_Image, "", $iPic_WebP, $iMPx_p, $iMPy_p) EndIf EndFunc Func LoadImage($sFileLoad) If $hImage_tmp Then _GDIPlus_ImageDispose($hImage_tmp) If $hImage Then _GDIPlus_ImageDispose($hImage) If $hImage_GDI Then _WinAPI_DeleteObject($hImage_GDI) If StringRight($sFileLoad, 5) = ".webp" Then If WebP_GetAmountOfAnimFrames($sFileLoad) > 0 Then Return MsgBox($MB_ICONERROR, "ERROR", "WebP animated image cannot be loaded!", 30, $hGUI) $hImage_tmp = WebP_BitmapCreateGDIp($sFileLoad) If @error Or $hImage_tmp = 0 Then Return MsgBox($MB_ICONERROR, "ERROR", "Unable to decode WebP image!", 30, $hGUI) EndIf Else $hImage_tmp = _GDIPlus_ImageLoadFromFile($sFileLoad) If @error Or $hImage_tmp = 0 Then Return MsgBox($MB_ICONERROR, "ERROR", "Unknown image format!", 30, $hGUI) EndIf EndIf $aPixelFormat = _GDIPlus_ImageGetPixelFormat($hImage_tmp) ;Local Const $aImageRawFormat = _GDIPlus_ImageGetRawFormat($hImage_tmp) If BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED) Then GUICtrlSetData($ipColorOriginal, BitmapCountColors($hImage_tmp)) Else GUICtrlSetData($ipColorOriginal, 0) EndIf ;~ If $hImage_tmp Then ConsoleWrite("Original color count: " & BitmapCountColors($hImage_tmp) & @CRLF) $aDim = _GDIPlus_ImageGetDimension($hImage_tmp) $hImage = _GDIPlus_BitmapCreateFromScan0($aDim[0], $aDim[1]) Local Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) If $aPixelFormat[0] = 2498570 Then _GDIPlus_GraphicsClear($hGfx, $bGUIBgColor) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_tmp, 0, 0, $aDim[0], $aDim[1]) _GDIPlus_GraphicsDispose($hGfx) $hImage_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $bNew = True _WinAPI_LockWindowUpdate($hGUI) CompressAndDisplay($hImage, $aPixelFormat[1]) _WinAPI_LockWindowUpdate(0) EndFunc ;==>LoadImage Func CompressAndDisplay($hImage, $sFormat = "") Local $aDim = _GDIPlus_ImageGetDimension($hImage) If $hHBitmap Then _WinAPI_DeleteObject($hHBitmap) $pMemData = 0 $pMemData_Size = 0 Local $iPreset = GUICtrlRead($cbPreset) Switch $iPreset Case "Default" $iPreset = 0 Case "Picture" $iPreset = 1 Case "Photo" $iPreset = 2 Case "Graph" $iPreset = 3 Case "Last" $iPreset = 4 EndSwitch If IsDllStruct($tMem) Then WebP_FreeUp($tMem) $old_cursor = MouseGetCursor() GUISetCursor(15, 1, $hGUI) _GUICtrlStatusBar_SetBkColor($StatusBar, 192) Local $end, $fTimer = TimerInit() $tMem = WebP_CreateWebPAdvancedFromBitmap("", $hImage, _ BitAND(GUICtrlRead($chkbLossless), $GUI_CHECKED), _ GUICtrlRead($slQuality), _ GUICtrlRead($slMethod), _ GUICtrlRead($slSNS_Strength), _ GUICtrlRead($slFilter_Sharpness), _ GUICtrlRead($slFilter_Strength), _ GUICtrlRead($slPass), _ GUICtrlRead($slNear_Lossless), _ BitAND(GUICtrlRead($chkbAlpha_Compression), $GUI_CHECKED), _ GUICtrlRead($slAlpha_Filtering), _ GUICtrlRead($slAlpha_Quality), _ GUICtrlRead($ipTarget_Size), _ $iPreset, _ True) ;hold the compressed image in memory only, no save to HD! $end = TimerDiff($fTimer) ToolTip("") _GUICtrlStatusBar_SetBkColor($StatusBar, $iSBColor) GUISetCursor($old_cursor, 1, $hGUI) Local $iColorsWebp = 0 If IsDllStruct($tMem) Then _GUICtrlStatusBar_SetText($StatusBar, "WebP size: " & Round($tMem.memsize / 1024, 2) & " kb / encoded in " & Round($end, 2) & " ms.") $hHBitmap = WebP_BitmapCreateGDIpFromMem($tMem.pMemData, $tMem.memsize, 1, 0, 32, BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED)) If @error Then Return MsgBox($MB_ICONERROR, "ERROR", "Unable to compress image", 30, $hGUI) $iColorsWebp = @extended GUICtrlSetData($ipColorWebP, $iColorsWebp) If BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED) And GUICtrlRead($ipColorOriginal) = "0" Then GUICtrlSetData($ipColorOriginal, BitmapCountColors($hImage_tmp)) ;~ ConsoleWrite("WebP image color count: " & @extended & @CRLF) Local $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", ""), $tbw = 0, $tbh = 0 If $aTaskbar[2] > $aTaskbar[3] Then $tbh = $aTaskbar[3] ELse $tbw = $aTaskbar[2] EndIf Local Const $minw = 384, $minh = $minw * 10 / 16 Local $maxw = Min($aDim[0] + $dw, @DesktopWidth * 0.95), $maxh = Min($aDim[1] + $dh, @DesktopHeight * 0.95), $iNewW = 0, $iNewH = 0 If $aDim[0] + $dw > @DesktopWidth * 0.95 Or $aDim[1] + $dh > @DesktopHeight * 0.95 Then $bBigger = True Else $bBigger = False EndIf If $bNew Then $iNewW = Max($minw, $maxw) $iNewH = Max($minh, $maxh) WinMove($hGUI_Image, "", (@DesktopWidth - $iNewW - (@DesktopWidth - $iW > $iNewW ? $iW : 0)) / 2 - $tbw, (@DesktopHeight - $iNewH - $tbh) / 2, $iNewW, $iNewH) WinSetTitle($hGUI_Image, "", StringRegExpReplace($sFileLoad, ".+\\(.*)", "$1") & " / " & $aDim[0] & "x" & $aDim[1] & " px / " & $sFormat & " / " & Round(FileGetSize($sFileLoad) / 1024, 2) & " kb") $iNewH -= $dh ;_WinAPI_GetSystemMetrics($SM_CXBORDER) + _WinAPI_GetSystemMetrics($SM_CYSIZE) + _WinAPI_GetSystemMetrics($SM_CXPADDEDBORDER) * 2 $iMPx_p = ($iNewW - $aDim[0]) / 2 $iMPy_p = ($iNewH - $aDim[1] - 4) / 2 $iResetPosX = $iMPx_p $iResetPosY = $iMPy_p GUICtrlSetPos($iPic_WebP, $iMPx_p, $iMPy_p, $iNewW - 1, $iNewH - 1) $bNew = False EndIf _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) Local Const $iWC_State = WinGetState($hGUI_Image) If $iWC_State <> 7 Or $iWC_State <> 5 Then WinSetState($hGUI_Image, "", @SW_SHOW) WinActivate($hGUI_Image) EndIf WinActivate($hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "DLL encode error " & $tMem, 30) EndIf EndFunc ;==>CompressAndDisplay Func Progress($progress, $ptr) ToolTip($progress & "%", MouseGetPos(0) - 40, MouseGetPos(1)) Return 1 EndFunc Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam Switch $lParam Case $hslAlpha_Filtering GUICtrlSetData($ipAlpha_Filtering, GUICtrlRead($slAlpha_Filtering)) Case $hslAlpha_Quality GUICtrlSetData($ipAlpha_Quality, GUICtrlRead($slAlpha_Quality)) Case $hslFilter_Sharpness GUICtrlSetData($ipFilter_Sharpness, GUICtrlRead($slFilter_Sharpness)) Case $hslFilter_Strength GUICtrlSetData($ipFilter_Strength, GUICtrlRead($slFilter_Strength)) Case $hslLevel GUICtrlSetData($ipLevel, GUICtrlRead($slLevel)) Case $hslMethod GUICtrlSetData($ipMethod, GUICtrlRead($slMethod)) Case $hslNear_Lossless GUICtrlSetData($ipNear_Lossless, GUICtrlRead($slNear_Lossless)) Case $hslPass GUICtrlSetData($ipPass, GUICtrlRead($slPass)) Case $hslQuality GUICtrlSetData($ipQuality, GUICtrlRead($slQuality)) Case $hslSNS_Strength GUICtrlSetData($ipSSN_Strength, GUICtrlRead($slSNS_Strength)) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_HSCROLL Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) Local $i = 1 Local $aFileList = _WinAPI_DragQueryFileEx($wParam) Do If StringInStr(FileGetAttrib($aFileList[$i]), "D") Then _ArrayDelete($aFileList, $i) Else $i += 1 EndIf Until $i = UBound($aFileList) $aFileList[0] = UBound($aFileList) - 1 $sFileLoad = $aFileList[1] _WinAPI_DragFinish($wParam) LoadImage($sFileLoad) Return 0 EndFunc ;==>WM_DROPFILES# Func WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hWnd, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc ;==>_WM_LBUTTONDOWN Func WM_SYSCOMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $ilParam Switch BitAND($iwParam, 0x0000FFFF) Case $idAbout GUICtrlSendToDummy($iDummy_About) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_SYSCOMMAND Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Switch $iwParam Case 1 GUICtrlSendToDummy($iDummy_Return) Return 0 Case $idResetPicPos ResetImage() Return 0 Case $idResetValues GUICtrlSetData($slAlpha_Filtering, 1) GUICtrlSetData($ipAlpha_Filtering, 1) GUICtrlSetData($slAlpha_Quality, 100) GUICtrlSetData($ipAlpha_Quality, 100) GUICtrlSetData($slFilter_Sharpness, 0) GUICtrlSetData($ipFilter_Sharpness, 0) GUICtrlSetData($slFilter_Strength, 60) GUICtrlSetData($ipFilter_Strength, 60) GUICtrlSetData($slLevel, 6) GUICtrlSetData($ipLevel, 6) GUICtrlSetData($slMethod, 4) GUICtrlSetData($ipMethod, 4) GUICtrlSetData($slNear_Lossless, 60) GUICtrlSetData($ipNear_Lossless, 60) GUICtrlSetData($slPass, 6) GUICtrlSetData($ipPass, 6) GUICtrlSetData($slQuality, 75) GUICtrlSetData($ipQuality, 75) GUICtrlSetData($slSNS_Strength, 50) GUICtrlSetData($ipSSN_Strength, 50) GUICtrlSetData($ipTarget_Size, 0) GUICtrlSetState($chkbAlpha_Compression, $GUI_CHECKED) GUICtrlSetState($chkbLossless, $GUI_UNCHECKED) _SendMessage($hcbPreset, $CB_SETCURSEL, 0) Return 0 EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_COMMAND Func WM_CONTEXTMENU($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch $hWnd Case $hGUI Local $hMenu $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hMenu, 0, "Reset values to default", $idResetValues) If $bBigger Then _GUICtrlMenu_InsertMenuItem($hMenu, 1, 0) _GUICtrlMenu_InsertMenuItem($hMenu, 2, "Reset image position", $idResetPicPos) EndIf _GUICtrlMenu_TrackPopupMenu($hMenu, $wParam) _GUICtrlMenu_DestroyMenu($hMenu) Return True EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_CONTEXTMENU Func Max($a, $b) If $a > $b Then Return $a Return $b EndFunc Func Min($a, $b) If $a < $b Then Return $a Return $b EndFunc Func GDIPlus_About($iFontsize = 10, $dx = 0, $dy = 0, $iSpeed = 333, $sFont = "MV Boli") If @AutoItX64 = 0 Then Local $binSIDSound = _Chip_Sound() _SIDStartup() _SIDOpen($binSIDSound) EndIf Local Const $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ About Window" Local Const $fPi = ACos(-1), $fRad = $fPi / 180, $fDeg = 180 / $fPi #Region text Local $sText = _ " WebP Advanced Encoder GUI ²" & _ " " & $ver & " beta " & _ " " & $build & " " & _ " " & _ " Coded by UEZ ;-) " & _ " " & _ "Credits to: " & _ " " & _ "* Google for the WebP API " & _ " and static libraries " & _ "* wakillon for TichySID " & _ " and Stat-Mat for the DLL " & _ "* Soren Lund for SID Tune " & _ "* Ward for Mem call code " & _ " " & _ "-------------------------- " & _ " " & _ "Greetings fly out to: " & _ " " & _ " All Autoit users " & _ " around the globe " & _ " " & _ " " & _ " Press ESC to exit. " & _ " " & _ " " & _ "-------------------------- " & _ " " & _ "NO ..--+++--.. WAR " & _ " .-' | `-. " & _ " +' | `+ " & _ " ' | ` " & _ " ' | ` " & _ ": | : " & _ ": +'|`+ : " & _ ". +' | `+ ; " & _ " + +' | `+ + " & _ " `. +' | `+ .' " & _ " `._ | _.' " & _ "Peace `--.._|_..--' :-) " #EndRegion $bExit = False $hGUI_About = GUICreate($sTitle, $iW, $iH, 0, 0, $WS_POPUP, $WS_EX_NOPARENTNOTIFY, $hGUI) _WinAPI_SetParent($hGUI_About, $hGUI) WinSetTrans($hGUI_About, "", 0xD8) GUISetState(@SW_SHOWNA, $hGUI_About) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI_About) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrush_Clr = _GDIPlus_HatchBrushCreate(18, 0xF0B0B0E0, 0xF0F0F0FF), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0808080), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 100, 24) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") Local $iLen = StringLen($sText), $iColums = StringInStr($sText, "²"), $i, $u, $s, $r, $iChar_Space, $x, $y, $t = 0, $f, $b = 0, $a = 512, $iCharCol = 0x101030 $sText = StringReplace($sText, "²", " ") Local $aChars = StringSplit($sText, "", 2) Local $hFormat_char = _GDIPlus_StringFormatCreate(), $hFamily_char = _GDIPlus_FontFamilyCreate($sFont), $hFont_char = _GDIPlus_FontCreate($hFamily_char, $iFontsize, 1), _ $tLayout_char = _GDIPlus_RectFCreate(), $hBrush_char = _GDIPlus_BrushCreateSolid(0xFF000000 + $iCharCol) Local Const $iMilliSeconds = 5 AdlibRegister("CalcFPS", 1000) Do DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH) ;erase canvas background For $i = 0 To UBound($aChars) - 1 If $aChars[$i] <> " " Then $f = $t - $i / $iSpeed $s = $f > 2 ? 2 : $f $s = $s > 0 ? $s : 0 $r = (2 - $s) * $iColums * $iColums $iChar_Space = $s / 5.1 * $iColums $tLayout_char.x = $dx + $r / 2 * Sin($t + $i) + Mod($i, $iColums) * $iChar_Space $tLayout_char.y = $dy + $r / 3 * Cos($t + $i) + Int($i / $iColums) * $iChar_Space * 1.3333 DllCall($__g_hGDIPDll, "int", "GdipDrawString", "handle", $hCanvas, "wstr", $aChars[$i], "int", -1, "handle", $hFont_char, "struct*", $tLayout_char, "handle", $tLayout_char, "handle", $hBrush_char) EndIf Next $t += 0.025 DllCall($__g_hGDIPDll, "int", "GdipDrawString", "handle", $hCanvas, "wstr", "FPS: " & $iShowFPS, "int", -1, "handle", $hFont_FPS, "struct*", $tLayout_FPS, "handle", $hFormat_FPS, "handle", $hBrush_FPS) DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop If $r = 0 Then $b = 1 If $b Then $a -= 5 If $a < 256 Then DllCall($__g_hGDIPDll, "int", "GdipSetSolidFillColor", "handle", $hBrush_char, "dword", BitShift(Max(0, $a), -24) + $iCharCol) If $a <= -50 Then $b = 0 $a = 384 DllCall($__g_hGDIPDll, "int", "GdipSetSolidFillColor", "handle", $hBrush_char, "dword", 0xFF000000 + $iCharCol) $t = 0 EndIf EndIf DllCall($_KERNEL32DLL, "dword", "SleepEx", "dword", $iMilliSeconds, "bool", True) Until False AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_FontDispose($hFont_char) _GDIPlus_FontFamilyDispose($hFamily_char) _GDIPlus_StringFormatDispose($hFormat_char) _GDIPlus_BrushDispose($hBrush_char) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI_About, $hDC) GUIDelete($hGUI_About) If @AutoItX64 = 0 Then _SIDStop() _SIDClose() _SIDShutdown() $binSIDSound = 0 EndIf EndFunc ;==>GDIPlus_About Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func _GDIPlus_GraphicsGetDPIRatio($iDPIDef = 96) Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(0) If @error Then Return SetError(1, @extended, 0) Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @extended, 0) Local $iDPI = $aResult[2] _GDIPlus_GraphicsDispose($hGfx) Local $aResults[2] = [$iDPIDef / $iDPI, $iDPI / $iDPIDef] Return $aResults EndFunc ;==>_GDIPlus_GraphicsGetDPIRatio Func _WinAPI_GetDpiForMonitor($dpiType = $MDT_DEFAULT, $iDPIDef = 96) Local $aMonitors = _WinAPI_EnumDisplayMonitors() Local $x, $y Local $aRet = DllCall("Shcore.dll", "long", "GetDpiForMonitor", "long", $aMonitors[1][0], "int", $dpiType, "uint*", $x, "uint*", $y) If @error Or Not IsArray($aRet) Then Return SetError(1, 0, 0) Local $aDPI[2] = [$iDPIDef / $aRet[3], $aRet[3] / $iDPIDef] Return $aDPI EndFunc ;==>_WinAPI_GetDpiForMonitor Func _WinAPI_SetDPIAwareness($hGUI = 0) Switch @OSBuild Case 6000 To 9199 If Not DllCall("user32.dll", "bool", "SetProcessDPIAware") Then Return SetError(1, 0, 0) Return 1 Case 9200 To 13999 _WinAPI_SetProcessDpiAwareness($PROCESS_PER_MONITOR_DPI_AWARE) If @error Then Return SetError(1, 0, 0) Return 1 Case @OSBuild > 13999 #cs Context_Unaware = ((DPI_AWARENESS_CONTEXT)(-1)), Context_SystemAware = ((DPI_AWARENESS_CONTEXT)(-2)), Context_PerMonitorAware = ((DPI_AWARENESS_CONTEXT)(-3)), Context_PerMonitorAwareV2 = ((DPI_AWARENESS_CONTEXT)(-4)), Context_UnawareGdiScaled = ((DPI_AWARENESS_CONTEXT)(-5)) #ce _WinAPI_SetProcessDpiAwarenessContext($Context_PerMonitorAwareV2, $hGUI) If @error Then Return SetError(3, @error, 0) Return 1 EndSwitch Return -1 EndFunc ;==>_WinAPI_SetDPIAwareness Func _WinAPI_SetProcessDpiAwareness($DPIAware) ;https://docs.microsoft.com/en-us/windows/desktop/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness DllCall("Shcore.dll", "long", "SetProcessDpiAwareness", "int", $DPIAware) If @error Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_WinAPI_SetProcessDpiAwareness ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext Func _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext = $Context_PerMonitorAware, $hGUI = 0, $iMode = 1) ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 3) ? 3 : $iMode Switch $iMode Case 1 Local $hDC = _WinAPI_GetDC($hGUI) Local $aResult1 = DllCall("user32.dll", "ptr", "GetDpiFromDpiAwarenessContext", "ptr", $hDC) If @error Or Not IsArray($aResult1) Then Return SetError(11, 0, 0) _WinAPI_ReleaseDC(0, $hDC) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult1[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(12, 0, 0) Case 2 ;~ If Not $hGUI Then $hGUI = WinGetHandle(AutoItWinGetTitle()) Local $aResult2 = DllCall("user32.dll", "int", "GetWindowDpiAwarenessContext", "ptr", $hGUI) If @error Or Not IsArray($aResult2) Then Return SetError(21, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult2[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(22, 0, 0) Case 3 Local $aResult31 = DllCall("user32.dll", "ptr", "GetThreadDpiAwarenessContext") If @error Or Not IsArray($aResult31) Then Return SetError(31, 0, 0) Local $aResult32 = DllCall("user32.dll", "ptr", "GetAwarenessFromDpiAwarenessContext", "ptr", $aResult31[0]) If @error Or Not IsArray($aResult32) Then Return SetError(32, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetThreadDpiAwarenessContext", "int", $aResult32[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(33, 0, 0) EndSwitch Return 1 EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _Chip_Sound($bSaveBinary = False, $sSavePath =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uwYA+z+4lhG7FgD7P7tBv7/4JgErNi+4FgHrNi+7BgErP7iWEesWASs/u0Hvv/gmAWs2L7gWAis2L7sGAWs/uJYSKxYBaz+7Qi+/+OZwD/kWAMtmb7/2H+hgD+AP+EYQD+AP6FAP6HAP4AhgCEAP6FAIYAhwCGAP+PYCf8LPwi/Cf8Lvwi/Cn8Lvwl/Cn8Kvwl/Cf8Kvws/Cf/iGAn/Cz8Ivwn/C78Ivwp/C78Jfwp/Cr8Jfwn/Cr8LPwn/4JgErNi+4FgFLNi+7BgFLP7iWEgsWAUs/u0IPv/kmAnt2L7Y/5gI7di+2P+YCK3Yvtj/mAet2L7Y/6TYBu3avty/rlg/v+bYDG+YvuSYCe3Yvtj/mAjt2L7Y/5gIrdi+2P+YB63Yvtj/pNgG7dy+2f+/5lgJ/ws/CL8J/wu/CL8Kfwu/CX8Kfwq/CX8J/wq/Cy9J//8YA+4aPt1/mv7vGP7b/7/l2MAZ/6VYAq6bvtr/rtn/rxj/pprAP+SYCe3Yvtj/mAjt2L7Y/6WYC63Yvtj/mAqt2L7Y/6TYCe3avty/rlg/v+bYCe+YvuSYCe3Yvtj/mAjt2L7Y/6WYC63Yvtj/mAqt2L7Y/6TYCe3cvtn/v+XYQCYYCL8J/wu/CL8KfwulwD8+5gq/CX8J/wq/Cz8J/+eYBjAYvvBY/vC+8Nn+8Rj+8X7xvtgSshi+8dgSsj+Sshi+8dgSsj+nxvJavvKYD9m+/+eYBjAYvvBY/vC+8Nn+8Rj+8X7y2H7zPtgSshi+8dgSsj+Sshi+8dgSsj+nz/KYvuXYwCHYQCQYwAAhWEA/w==' Local $bString = _WinAPI_Base64Decode($Chip_Sound) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Commodore_64.sid", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Chip_Sound Func _WebP_Icon($bSaveBinary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VOIRv9ra2vLy8oGBAefOOXJfRnNDk0DL6ejokA5z941kB8bGxv7722msAxF4B6D0K05KGJl3MJ01mXGS+F6BAzmbZQv3eQXkG4Xdi4RQ7jehbOCAgyP3P94Red6jcQCLAAAAAElFTkSuQmCC' Local $bString = _WinAPI_Base64Decode($WebP_Icon) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\WebP_logo_2010_64x64_Simo99.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_WebP_Icon Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode #Region TichySID Func _SIDClose() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDClose') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDClose Func _SIDOpen($Sid, $iSubsong = 1) Local $bSid If Not IsBinary($Sid) Then If Not FileExists($Sid) Then Return SetError(2, 0, 0) Local $hFileOpen = FileOpen($Sid, 0) If $hFileOpen = -1 Then Return SetError(-1, 0, 0) $bSid = FileRead($hFileOpen) FileClose($hFileOpen) Else $bSid = $Sid EndIf Local $tSid = DllStructCreate('byte[' & BinaryLen($bSid) & ']') DllStructSetData($tSid, 1, $bSid) Local $sType = BinaryToString(BinaryMid($bSid, 1, 4), 1) ConsoleWrite('-->-- Sid File Type : ' & $sType & @CRLF) Local $iVersion = Execute(BinaryMid($bSid, 5, 2)) ConsoleWrite('-->-- Sid File Version : ' & $iVersion & @CRLF) $iSubsongCount = Int(StringTrimLeft(BinaryMid($bSid, 15, 2), 2)) ConsoleWrite('-->-- SubsongCount : ' & $iSubsongCount & @CRLF) $iSubsong = $iSubsong - 1 If $iSubsong < 0 Then $iSubsong = 0 If $iSubsong > $iSubsongCount Then $iSubsong = 0 ConsoleWrite('-->-- Subsong : ' & $iSubsong & @CRLF) Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDOpen', 'ptr', DllStructGetPtr($tSid), 'int', DllStructGetSize($tSid), 'int', $SID_MEMORY, 'int', $SID_NON_DEFAULT, 'int', $iSubsong) If @error Then Return SetError(@error, 0, 0) $tSid = 0 $bSid = 0 Return $aRet[0] EndFunc ;==>_SIDOpen Func _SIDShutdown() MemoryDllClose($hTitchysidDll) $hTitchysidDll = 0 EndFunc ;==>_SIDShutdown Func _SIDStartup() $hTitchysidDll = MemoryDllOpen(TitchySIDdll()) If $hTitchysidDll = -1 Then Return SetError(1, 0, 0) Return SetError(0, 0, $hTitchysidDll) EndFunc ;==>_SIDStartup Func _SIDStop() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDStop') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDStop Func TitchySIDdll() ;only x86 :-( Local $sFileBin = 'cbsATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAsAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGADvpjpN/iODAQQUDg6jywHwAB/EQl/PAZQAHUmljBmgBFwVzUEUAAEyAAQQA9O0oVQUTAOAADiELAQUMpAASAAzMAgegEAADfjAECQELABoB5wEABQcA/iCAfgQGgxwAFIEVhgMDA2BgMgAAvoEDgCc84RmKEAM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ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ABAA=' $sFileBin = Binary(_WinAPI_Base64Decode($sFileBin)) $sFileBin = Binary(_LzntDecompress($sFileBin)) Return SetError(0, 0, $sFileBin) EndFunc ;==>TitchySIDdll Func _LzntDecompress($bBinary) $bBinary = Binary($bBinary) Local $tInput = DllStructCreate('byte[' & BinaryLen($bBinary) & ']') DllStructSetData($tInput, 1, $bBinary) Local $tBuffer = DllStructCreate('byte[' & 16 * DllStructGetSize($tInput) & ']') Local $a_Call = DllCall('ntdll.dll', 'int', 'RtlDecompressBuffer', 'ushort', 2, 'ptr', DllStructGetPtr($tBuffer), 'dword', DllStructGetSize($tBuffer), 'ptr', DllStructGetPtr($tInput), 'dword', DllStructGetSize($tInput), 'dword*', 0) If @error Or $a_Call[0] Then Return SetError(1, 0, '') Local $tOutput = DllStructCreate('byte[' & $a_Call[6] & ']', DllStructGetPtr($tBuffer)) Return SetError(0, 0, DllStructGetData($tOutput, 1)) EndFunc ;==>_LzntDecompress Func API_FreeLibrary($Module) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'FreeLibrary', 'handle', $Module) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_FreeLibrary Func API_GetProcAddress($Module, $Procname) If IsNumber($Procname) Then Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'int', $Procname) Else Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'str', $Procname) EndIf If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_GetProcAddress Func API_IsBadReadPtr($Ptr, $Len) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'IsBadReadPtr', 'ptr', $Ptr, 'UINT_PTR', $Len) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_IsBadReadPtr Func API_LoadLibrary($Filename) Local $Ret = DllCall($_KERNEL32DLL, 'handle', 'LoadLibraryW', 'wstr', $Filename) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_LoadLibrary Func API_lstrlenA($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenA', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenA Func API_lstrlenW($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenW', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenW Func API_VirtualProtect($Address, $Size, $Protection) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'VirtualProtect', 'ptr', $Address, 'dword_ptr', $Size, 'dword', $Protection, 'dword*', 0) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_VirtualProtect Func API_ZeroMemory($Address, $Size) Local $Ret = DllCall($_KERNEL32DLL, 'none', 'RtlZeroMemory', 'ptr', $Address, 'dword_ptr', $Size) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_ZeroMemory Func MemLib_BuildImportTable($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 Local Const $SizeOfPtr = DllStructGetSize(DllStructCreate('ptr', 1)) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ImportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_IMPORT * $SizeOfDataDirectory Local $ImportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ImportDirectoryPtr) Local $ImportSize = DllStructGetData($ImportDirectory, 'Size') Local $ImportVirtualAddress = DllStructGetData($ImportDirectory, 'VirtualAddress') Local $SizeOfImportDir = DllStructGetSize(DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR)) Local $ImportList = '' If $ImportSize > 0 Then Local $ImportDescPtr = $CodeBase + $ImportVirtualAddress While 1 If API_IsBadReadPtr($ImportDescPtr, $SizeOfImportDir) Then ExitLoop Local $ImportDesc = DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR, $ImportDescPtr) Local $NameOffset = DllStructGetData($ImportDesc, 'Name') If $NameOffset = 0 Then ExitLoop Local $Name = Peek('str', $CodeBase + $NameOffset) Local $OriginalFirstThunk = DllStructGetData($ImportDesc, 'OriginalFirstThunk') Local $FirstThunk = DllStructGetData($ImportDesc, 'FirstThunk') Local $Handle = API_LoadLibrary($Name) If $Handle Then $ImportList &= $Handle & ',' Local $FuncRef = $CodeBase + $FirstThunk Local $ThunkRef = $CodeBase + $OriginalFirstThunk If $OriginalFirstThunk = 0 Then $ThunkRef = $FuncRef While 1 Local $Ref = Peek('ptr', $ThunkRef) If $Ref = 0 Then ExitLoop If BitAND(Peek('byte', $ThunkRef + $SizeOfPtr - 1), 0x80) Then Local $Ptr = API_GetProcAddress($Handle, BitAND($Ref, 0xffff)) Else Local $IMAGE_IMPORT_BY_NAME = DllStructCreate($tagIMAGE_IMPORT_BY_NAME, $CodeBase + $Ref) Local $NamePtr = DllStructGetPtr($IMAGE_IMPORT_BY_NAME, 2) Local $FuncName = Peek('str', $NamePtr) Local $Ptr = API_GetProcAddress($Handle, $FuncName) EndIf If $Ptr = 0 Then Return SetError(1, 0, False) Poke('ptr', $FuncRef, $Ptr) $ThunkRef += $SizeOfPtr $FuncRef += $SizeOfPtr WEnd Else Return SetError(1, 0, False) EndIf $ImportDescPtr += $SizeOfImportDir WEnd EndIf Return $ImportList EndFunc ;==>MemLib_BuildImportTable Func MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $VirtualAddress = DllStructGetData($Section, 'VirtualAddress') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $PointerToRawData = DllStructGetData($Section, 'PointerToRawData') If $SizeOfRawData = 0 Then Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SectionAlignment, $MEM_COMMIT, $PAGE_READWRITE) API_ZeroMemory($Dest, $SectionAlignment) Else Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SizeOfRawData, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr + $PointerToRawData, $Dest, $SizeOfRawData) EndIf DllStructSetData($Section, 'VirtualSize', $Dest - $CodeBase) $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_CopySections Func MemLib_FinalizeSections($CodeBase, $PEHeader) Local Const $IMAGE_SCN_MEM_EXECUTE = 0x20000000 Local Const $IMAGE_SCN_MEM_READ = 0x40000000 Local Const $IMAGE_SCN_MEM_WRITE = 0x80000000 Local Const $IMAGE_SCN_MEM_NOT_CACHED = 0x4000000 Local Const $IMAGE_SCN_CNT_INITIALIZED_DATA = 64 Local Const $IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 Local Const $PAGE_WRITECOPY = 0x0008 Local Const $PAGE_EXECUTE_WRITECOPY = 0x0080 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $Characteristics = DllStructGetData($Section, 'Characteristics') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $Executable = (BitAND($Characteristics, $IMAGE_SCN_MEM_EXECUTE) <> 0) Local $Readable = (BitAND($Characteristics, $IMAGE_SCN_MEM_READ) <> 0) Local $Writeable = (BitAND($Characteristics, $IMAGE_SCN_MEM_WRITE) <> 0) Local $ProtectList[8] = [$PAGE_NOACCESS, $PAGE_EXECUTE, $PAGE_READONLY, $PAGE_EXECUTE_READ, $PAGE_WRITECOPY, $PAGE_EXECUTE_WRITECOPY, $PAGE_READWRITE, $PAGE_EXECUTE_READWRITE] Local $Protect = $ProtectList[$Executable + $Readable * 2 + $Writeable * 4] If BitAND($Characteristics, $IMAGE_SCN_MEM_NOT_CACHED) Then $Protect = BitOR($Protect, $PAGE_NOCACHE) Local $Size = $SizeOfRawData If $Size = 0 Then If BitAND($Characteristics, $IMAGE_SCN_CNT_INITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfInitializedData') ElseIf BitAND($Characteristics, $IMAGE_SCN_CNT_UNINITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfUninitializedData') EndIf EndIf If $Size > 0 Then Local $PhysicalAddress = $CodeBase + DllStructGetData($Section, 'VirtualSize') API_VirtualProtect($PhysicalAddress, $Size, $Protect) EndIf $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_FinalizeSections Func MemLib_FreeLibrary($ModulePtr) If Not MemLib_Vaild($ModulePtr) Then Return 0 Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') Local $DllEntry = DllStructGetData($Module, 'DllEntry') Local $Initialized = DllStructGetData($Module, 'Initialized') Local $ImportListPtr = DllStructGetData($Module, 'ImportList') Local $ExportListPtr = DllStructGetData($Module, 'ExportList') If $Initialized And $DllEntry Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 0, 'ptr', 0) DllStructSetData($Module, 'Initialized', 0) EndIf If $ExportListPtr Then _MemGlobalFree($ExportListPtr) If $ImportListPtr Then Local $ImportList = StringSplit(Peek('str', $ImportListPtr), ',') For $i = 1 To $ImportList[0] If $ImportList[$i] Then API_FreeLibrary($ImportList[$i]) Next _MemGlobalFree($ImportListPtr) EndIf If $CodeBase Then _MemVirtualFree($CodeBase, 0, $MEM_RELEASE) DllStructSetData($Module, 'CodeBase', 0) DllStructSetData($Module, 'ExportList', 0) _MemGlobalFree($ModulePtr) Return 1 EndFunc ;==>MemLib_FreeLibrary Func MemLib_GetExportList($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_EXPORT = 0 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ExportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_EXPORT * $SizeOfDataDirectory Local $ExportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ExportDirectoryPtr) Local $ExportSize = DllStructGetData($ExportDirectory, 'Size') Local $ExportVirtualAddress = DllStructGetData($ExportDirectory, 'VirtualAddress') Local $ExportList = '' If $ExportSize > 0 Then Local $IMAGE_EXPORT_DIRECTORY = DllStructCreate($tagIMAGE_EXPORT_DIRECTORY, $CodeBase + $ExportVirtualAddress) Local $NumberOfNames = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfNames') Local $NumberOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfFunctions') Local $AddressOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfFunctions') If $NumberOfNames = 0 Or $NumberOfFunctions = 0 Then Return '' Local $NameRef = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNames') Local $Ordinal = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNameOrdinals') For $i = 1 To $NumberOfNames Local $Ref = Peek('dword', $NameRef) Local $Idx = Peek('word', $Ordinal) Local $FuncName = Peek('str', $CodeBase + $Ref) If $Idx <= $NumberOfFunctions Then Local $Addr = $CodeBase + Peek('dword', $CodeBase + $AddressOfFunctions + $Idx * 4) $ExportList &= $FuncName & Chr(1) & $Addr & Chr(1) EndIf $NameRef += 4 $Ordinal += 2 Next EndIf Return $ExportList EndFunc ;==>MemLib_GetExportList Func MemLib_GetProcAddress($ModulePtr, $FuncName) Local $ExportPtr = Peek('ptr', $ModulePtr) If Not $ExportPtr Then Return 0 Local $ExportList = Peek('str', $ExportPtr) Local $Match = StringRegExp($ExportList, '(?i)' & $FuncName & '\001([^\001]*)\001', 3) If Not @error Then Return Ptr($Match[0]) Return 0 EndFunc ;==>MemLib_GetProcAddress Func MemLib_LoadLibrary($DllBinary) $DllBinary = Binary($DllBinary) Local $DllData = DllStructCreate('byte[' & BinaryLen($DllBinary) & ']') Local $DllDataPtr = DllStructGetPtr($DllData) DllStructSetData($DllData, 1, $DllBinary) Local $IMAGE_DOS_HEADER = DllStructCreate($tagIMAGE_DOS_HEADER, $DllDataPtr) If DllStructGetData($IMAGE_DOS_HEADER, 'e_magic') <> 0x5A4D Then Return SetError(1, 0, 0) EndIf Local $PEHeader = $DllDataPtr + DllStructGetData($IMAGE_DOS_HEADER, 'e_lfanew') Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) If DllStructGetData($IMAGE_NT_HEADER, 'Signature') <> 0x4550 Then Return SetError(1, 0, 0) EndIf Switch DllStructGetData($IMAGE_NT_HEADER, 'Magic') Case 0x10B If @AutoItX64 Then Return SetError(2, 0, 0) Case 0x20B If Not @AutoItX64 Then Return SetError(2, 0, 0) EndSwitch Local $ImageBase = DllStructGetData($IMAGE_NT_HEADER, 'ImageBase') Local $SizeOfImage = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfImage') Local $SizeOfHeaders = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfHeaders') Local $AddressOfEntryPoint = DllStructGetData($IMAGE_NT_HEADER, 'AddressOfEntryPoint') Local $ModulePtr = _MemGlobalAlloc(DllStructGetSize(DllStructCreate($tagModule)), $GPTR) If $ModulePtr = 0 Then Return SetError(3, 0, 0) Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = _MemVirtualAlloc($ImageBase, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then $CodeBase = _MemVirtualAlloc(0, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then Return SetError(3, 0, 0) DllStructSetData($Module, 'CodeBase', $CodeBase) _MemVirtualAlloc($CodeBase, $SizeOfImage, $MEM_COMMIT, $PAGE_READWRITE) Local $Base = _MemVirtualAlloc($CodeBase, $SizeOfHeaders, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr, $Base, $SizeOfHeaders) MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $LocationDelta = $CodeBase - $ImageBase If $LocationDelta <> 0 Then MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local $ImportList = MemLib_BuildImportTable($CodeBase, $PEHeader) If @error Then MemLib_FreeLibrary($ModulePtr) Return SetError(2, 0, 0) EndIf Local $ExportList = MemLib_GetExportList($CodeBase, $PEHeader) Local $ImportListPtr = _MemGlobalAlloc(StringLen($ImportList) + 2, $GPTR) Local $ExportListPtr = _MemGlobalAlloc(StringLen($ExportList) + 2, $GPTR) DllStructSetData($Module, 'ImportList', $ImportListPtr) DllStructSetData($Module, 'ExportList', $ExportListPtr) If $ImportListPtr = 0 Or $ExportListPtr = 0 Then MemLib_FreeLibrary($ModulePtr) Return SetError(3, 0, 0) EndIf Poke('str', $ImportListPtr, $ImportList) Poke('str', $ExportListPtr, $ExportList) MemLib_FinalizeSections($CodeBase, $PEHeader) Local $DllEntry = $CodeBase + $AddressOfEntryPoint DllStructSetData($Module, 'DllEntry', $DllEntry) DllStructSetData($Module, 'Initialized', 0) If $AddressOfEntryPoint Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 1, 'ptr', 0) If Not $Success[0] Then MemLib_FreeLibrary($ModulePtr) Return SetError(4, 0, 0) EndIf DllStructSetData($Module, 'Initialized', 1) EndIf Return $ModulePtr EndFunc ;==>MemLib_LoadLibrary Func MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local Const $IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 Local Const $IMAGE_REL_BASED_HIGHLOW = 3 Local Const $IMAGE_REL_BASED_DIR64 = 10 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $RelocDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_BASERELOC * $SizeOfDataDirectory Local $RelocDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $RelocDirectoryPtr) Local $RelocSize = DllStructGetData($RelocDirectory, 'Size') Local $RelocVirtualAddress = DllStructGetData($RelocDirectory, 'VirtualAddress') If $RelocSize > 0 Then Local $Relocation = $CodeBase + $RelocVirtualAddress While 1 Local $IMAGE_BASE_RELOCATION = DllStructCreate($tagIMAGE_BASE_RELOCATION, $Relocation) Local $VirtualAddress = DllStructGetData($IMAGE_BASE_RELOCATION, 'VirtualAddress') Local $SizeOfBlock = DllStructGetData($IMAGE_BASE_RELOCATION, 'SizeOfBlock') If $VirtualAddress = 0 Then ExitLoop Local $Dest = $CodeBase + $VirtualAddress Local $Entries = ($SizeOfBlock - 8) / 2 Local $RelInfo = DllStructCreate('word[' & $Entries & ']', $Relocation + 8) For $i = 1 To $Entries Local $Info = DllStructGetData($RelInfo, 1, $i) Local $Type = BitShift($Info, 12) If $Type = $IMAGE_REL_BASED_HIGHLOW Or $Type = $IMAGE_REL_BASED_DIR64 Then Local $Addr = DllStructCreate('ptr', $Dest + BitAND($Info, 0xFFF)) DllStructSetData($Addr, 1, DllStructGetData($Addr, 1) + $LocationDelta) EndIf Next $Relocation += $SizeOfBlock WEnd EndIf EndFunc ;==>MemLib_PerformBaseRelocation Func MemLib_Vaild($ModulePtr) Local $ModuleSize = DllStructGetSize(DllStructCreate($tagModule)) If API_IsBadReadPtr($ModulePtr, $ModuleSize) Then Return False Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') If Not $CodeBase Then Return False Return True EndFunc ;==>MemLib_Vaild Func MemoryDllCall($Module, $RetType, $FuncName, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) Local $Ret, $OpenFlag = False Local Const $MaxParams = 20 If (@NumParams < 3) Or (@NumParams > $MaxParams * 2 + 3) Or (Mod(@NumParams, 2) = 0) Then Return SetError(4, 0, 0) If Not IsPtr($Module) Then $OpenFlag = True $Module = MemoryDllOpen($Module) If @error Then Return SetError(1, 0, 0) EndIf Local $Addr = MemLib_GetProcAddress($Module, $FuncName) If Not $Addr Then Return SetError(3, 0, 0) Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Addr) Switch @NumParams Case 3 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 5 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 7 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 9 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 11 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 13 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall ( $_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 5 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ' )' $Ret = Execute($DllCallStr) EndSwitch Local $Err = @error If $OpenFlag Then MemoryDllClose($Module) Return SetError($Err, 0, $Ret) EndFunc ;==>MemoryDllCall Func MemoryDllClose($Module) MemLib_FreeLibrary($Module) EndFunc ;==>MemoryDllClose Func MemoryDllOpen($DllBinary) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Local $Module = MemLib_LoadLibrary($DllBinary) If @error Then Return SetError(@error, 0, -1) Return $Module EndFunc ;==>MemoryDllOpen Func MemoryFuncCall($RetType, $Address, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Address) Local $Ret Switch @NumParams Case 2 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 4 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 6 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 8 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 10 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 12 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall($_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 4 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ')' $Ret = Execute($DllCallStr) EndSwitch Return SetError(@error, 0, $Ret) EndFunc ;==>MemoryFuncCall Func MemoryFuncInit() Local $KernelHandle = API_LoadLibrary('kernel32.dll') API_FreeLibrary($KernelHandle) Local $HookPtr = API_GetProcAddress($KernelHandle, $_MFHookApi) Local $HookSize = 7 + @AutoItX64 * 5 $_MFHookPtr = $HookPtr $_MFHookBak = DllStructCreate('byte[' & $HookSize & ']') If Not API_VirtualProtect($_MFHookPtr, $HookSize, $PAGE_EXECUTE_READWRITE) Then Return False DllStructSetData($_MFHookBak, 1, Peek('byte[' & $HookSize & ']', $_MFHookPtr)) If @AutoItX64 Then Poke('word', $_MFHookPtr, 0xB848) Poke('word', $_MFHookPtr + 10, 0xE0FF) Else Poke('byte', $_MFHookPtr, 0xB8) Poke('word', $_MFHookPtr + 5, 0xE0FF) EndIf Return True EndFunc ;==>MemoryFuncInit Func Peek($Type, $Ptr) If $Type = 'str' Then $Type = 'char[' & API_lstrlenA($Ptr) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & API_lstrlenW($Ptr) & ']' EndIf Return DllStructGetData(DllStructCreate($Type, $Ptr), 1) EndFunc ;==>Peek Func Poke($Type, $Ptr, $Value) If $Type = 'str' Then $Type = 'char[' & (StringLen($Value) + 1) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & (StringLen($Value) + 1) & ']' EndIf DllStructSetData(DllStructCreate($Type, $Ptr), 1, $Value) EndFunc ;==>Poke #EndRegion Download UDF, DLLs and examples on my 1Drv: WebP (to download all marked files, you must login first, otherwise 1by1 only)2 points
-
@pixelsearch let me think tomorrow about it. I changed a lot of internal functions from str to wstr to support unicode filenames and all examples must be touched otherwise crash. Currently I'm writing on an example in Freebasic (WebP Encoder GUI) how to use the DLL. Freebasic WebP DLL source code (my written DLL stuff, Google WebP dll will be linked as static library to my DLL) and other stuff can be found on my OneDrive, if you want to have a look under the hood.2 points
-
Move Gui with gif animation by button
Davidyese and one other reacted to pixelsearch for a topic
I was about to answer what follows, but @ioa747 was faster Help file, function GUIGetMsg : If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1. You can't use at same time : Opt('GUIOnEventMode', 1) ... GUIGetMsg() ; will not work when GUIOnEventMode option is set to 12 points -
GUICtrlCreateListView Problem loading data, first line of column # is deleted
angel83 and one other reacted to pixelsearch for a topic
Good news I found a way to display the vertical line constantly while dragging the horizontal scrollbar, with very few flickering. To do this : 1) Add the extended style $LVS_EX_DOUBLEBUFFER to your line _GUICtrlListView_SetExtendedListViewStyle(...) 2) In the code of my preceding post, please change one line as indicated below : ; If BitAND($wParam, 0xFFFF) = 0x4 Then ; LoWord . $SB_THUMBPOSITION = 0x4 . Msdn : "the user has dragged the scroll box (thumb) and released the mouse button" If BitAND($wParam, 0xFFFF) = 0x5 Then ; LoWord . $SB_THUMBTRACK = 0x5 . Msdn : "the user is dragging the scroll box"2 points -
JSON UDF in pure AutoIt
TheDcoder and one other reacted to SOLVE-SMART for a topic
Don't belittle yourself so much 😅 , your knowledge of AutoIt isn't bad at all. But I get your point @WildByDesign , yes. For beginners with JSON a proper example flow would be helpful. 🤝2 points -
JSON UDF in pure AutoIt
WildByDesign and one other reacted to SOLVE-SMART for a topic
Here a example how you can do it with jq directly instead of using the JSON.au3 UDF. Don't get me wrong, I like the JSON library (UDF) from @AspirinJunkie - he already knows that. I simply try to give you another perspective how you can handle a JSON file with a widespread (AutoIt independent) library. In case you want to stick with AutoIt, no problem, use the JQ adaption of @TheXman who creates this lovely json-processor. Best regards Sven2 points -
JSON UDF in pure AutoIt
WildByDesign and one other reacted to TheDcoder for a topic
You'll have to parse the array first and then manually insert the correct index into your commands. If you want to do it in a "cleaner" way, you can just modify the Array in AutoIt and insert the whole thing back with your changes.2 points -
2 points
-
2 points
-
Here is new script. It is neccessary to catch WM_NCPAINT and do drawing there. Coordinates are issue again. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPITheme.au3> #include "GUIDarkMode_v0.02mod.au3" #include "ModernMenuRaw.au3" #include <GuiMenu.au3> #include <Array.au3> #include <WinAPIDiag.au3> #include <WinAPIConv.au3> #include <WinAPIGdiDC.au3> ;~ DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext", "HWND", "DPI_AWARENESS_CONTEXT" - 4) _SetMenuBkColor(0x202020) _SetMenuIconBkColor(0x202020) _SetMenuIconBkGrdColor(0x202020) _SetMenuSelectBkColor(0x202020) _SetMenuSelectRectColor(0x202020) _SetMenuSelectTextColor(0xFFFFFF) _SetMenuTextColor(0xFFFFFF) Example() Func Example() $hGUI = GUICreate("My GUI", 300, 200) ;Local $idFileMenu = GUICtrlCreateMenu("&File") Local $idFileMenu = _GUICtrlCreateODTopMenu("&File", $hGUI) GUICtrlCreateMenuItem("&Open", $idFileMenu) GUICtrlCreateMenuItem("&Save", $idFileMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idOptionsMenu = GUICtrlCreateMenu("O&ptions", $idFileMenu) GUICtrlCreateMenuItem("View", $idOptionsMenu) GUICtrlCreateMenuItem("", $idOptionsMenu) GUICtrlCreateMenuItem("Tools", $idOptionsMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idExitItem = GUICtrlCreateMenuItem("&Exit", $idFileMenu) ;Local $idHelpMenu = GUICtrlCreateMenu("&?") Local $idHelpMenu = _GUICtrlCreateODTopMenu("&?", $hGUI) Local $idAboutItem = GUICtrlCreateMenuItem("&About", $idHelpMenu) Local $idEndBtn = GUICtrlCreateButton("End", 110, 140, 70, 20) Global $hSolidBrush = _WinAPI_CreateBrushIndirect($BS_SOLID, 0xFF00FF) GUIRegisterMsg($WM_NCPAINT, WM_NCPAINT) ;~ GUIRegisterMsg($WM_ERASEBKGND,WM_ERASEBKGND) ;~ GUIRegisterMsg($WM_PAINT,WM_PAINT) ;~ GUIRegisterMsg($WM_DRAWITEM, WM_DRAWITEM2) GuiDarkmodeApply($hGUI) GUISetState(@SW_SHOW) ;_drawUAHMenuNCBottomLine($hGUI) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $idExitItem, $idEndBtn, $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hSolidBrush) ExitLoop Case $idAboutItem MsgBox($MB_SYSTEMMODAL, "About...", "Colored menu sample") EndSwitch WEnd EndFunc ;==>Example Func WM_DRAWITEM2($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_DRAWITEM" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ;~ ConsoleWrite("$hDC=" & $wParam & @CRLF) WM_DRAWITEM($hWnd, $iMsg, $wParam, $lParam) ;~ _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) ;~ _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) ;~ _drawUAHMenuNCBottomLine($hWnd) Return True EndFunc ;==>WM_NCPAINT Func WM_PAINT($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_PAINT" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ;~ ConsoleWrite("$hDC=" & $wParam & @CRLF) _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 0 EndFunc ;==>WM_NCPAINT Func WM_ERASEBKGND($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_ERASEBKGND" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ConsoleWrite("$hDC=" & $wParam & @CRLF) ;_WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 1 EndFunc ;==>WM_NCPAINT Func WM_NCPAINT($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ConsoleWrite("$wParam=" & $wParam & @CRLF) _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 0 EndFunc ;==>WM_NCPAINT Func _drawUAHMenuNCBottomLine($hWnd) $aMenuBarInfo = _GUICtrlMenu_GetMenuBarInfo($hWnd, 0, 1) ;_ArrayDisplay($aMenuBarInfo) $rcClient = _WinAPI_GetClientRect($hWnd) ;_WinAPI_DisplayStruct($rcClient, $tagRECT, "rcClinet before") ;CHAT GPT Local $aCall = DllCall("user32.dll", "int", "MapWindowPoints", _ "hwnd", $hWnd, _ ; hWndFrom "hwnd", 0, _ ; hWndTo "ptr", DllStructGetPtr($rcClient), _ "uint", 2) ;number of points - 2 for RECT structure If @error Then ;MsgBox($MB_ICONERROR, "Error", @error) Exit EndIf ;_WinAPI_DisplayStruct($rcClient, $tagRECT, "rcClinet after") $rcWindow = _WinAPI_GetWindowRect($hWnd) _WinAPI_OffsetRect($rcClient, -$rcWindow.left, -$rcWindow.top) $rcAnnoyingLine = DllStructCreate($tagRECT) $rcAnnoyingLine.left = $rcClient.left $rcAnnoyingLine.top = $rcClient.top $rcAnnoyingLine.right = $rcClient.right $rcAnnoyingLine.bottom = $rcClient.bottom ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT) $rcAnnoyingLine.bottom = $rcAnnoyingLine.top $rcAnnoyingLine.top = $rcAnnoyingLine.top - 1 ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") ;~ $rcAnnoyingLine.left = 0 ;~ $rcAnnoyingLine.top = 0 ;~ $rcAnnoyingLine.right = 100 ;~ $rcAnnoyingLine.bottom = 200 $hRgn=_WinAPI_CreateRectRgn(0,0,1000,500) ;~ $hDC = _WinAPI_GetDC($hWnd) $hDC=_WinAPI_GetDCEx($hWnd,$hRgn, BitOR($DCX_WINDOW,$DCX_INTERSECTRGN)) If $hDC=0 Then ConsoleWrite("hDC=0" & @CRLF) EndIf _WinAPI_FillRect($hDC, $rcAnnoyingLine, $hSolidBrush) _WinAPI_ReleaseDC($hWnd, $hDC) ;_WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT, "annoying line") EndFunc ;==>_drawUAHMenuNCBottomLine2 points
-
interesting accident
pixelsearch and one other reacted to ioa747 for a topic
I had an interesting accident. (I thing) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Misc.au3> _ColorsSelection() Func _ColorsSelection() Local $hGUI = GUICreate("Colors Selection", 500, 500, -1, -1, -1) GUISetFont(10) GUICtrlCreateLabel("Red", 10, 10, 101, 17, 0x0002) GUICtrlCreateLabel("Green", 10, 140, 101, 17, 0x0002) Local $Button1 = GUICtrlCreateButton("", 120, 5, 50, 25, 0xFF0000) ; instead of 0x8000 I paste 0xFF0000 GUICtrlSetBkColor(-1, 0xFF0000) Local $Button2 = GUICtrlCreateButton("", 120, 135, 50, 25, 0xFF0000) ; instead of 0x8000 I paste 0xFF0000 GUICtrlSetBkColor(-1, 0x00FF00) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 ConsoleWrite("$Button1=" & $Button1 & @CRLF) Case $Button2 ConsoleWrite("$Button2=" & $Button2 & @CRLF) EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>_ColorsSelection2 points -
interesting accident
Parsix and one other reacted to pixelsearch for a topic
Maybe this explanation ? 1) Button when no style is indicated at creation (-1) , WS_TABSTOP will be forced (help file) Button style becomes 0x50010000 WS_CHILD, WS_VISIBLE, WS_TABSTOP [0x40000000, 'WS_CHILD'] [0x10000000, 'WS_VISIBLE'] [0x00010000, 'WS_TABSTOP'] 2) Button created with 0xFF0000 style Button style becomes 0x50FF0000 WS_CHILD, WS_VISIBLE, WS_OVERLAPPEDWINDOW, WS_VSCROLL, WS_HSCROLL [0x40000000, 'WS_CHILD'] [0x10000000, 'WS_VISIBLE'] [0x00CF0000, 'WS_OVERLAPPEDWINDOW'] [0x00200000, 'WS_VSCROLL'] [0x00100000, 'WS_HSCROLL'] 'WS_OVERLAPPEDWINDOW' means (WS_CAPTION | WS_SYSMENU | WS_SIZEBOX | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)2 points -
Another AutoIt extension for Visual Studio Code
SOLVE-SMART and one other reacted to genius257 for a topic
It was semi-manually, since i also needed to add parameter types and return types. 😅 semi, because i used my inline suggestions from my windsurf AI vscode extension to speed things up. That might be why the text is wrong at some places Edit: I've updated the summary for the two functions mentioned. It will be available with next version 😉2 points -
Ubound function not able to return number of objects in collection?
argumentum and one other reacted to Numeric1 for a topic
I’ve identified the root cause of the issue with $colNetAdapter.Count failing when querying Win32_NetworkAdapter via WMI. The problem arises from using the wbemFlagForwardOnly flag (0x20) in the ExecQuery method. This flag creates a forward-only cursor for the SWbemObjectSet collection, which optimizes performance for large datasets by allowing only sequential, one-time access to objects. However, this cursor type does not support the .Count property, resulting in the error: "The requested action with this object has failed."To resolve this, you should use only the wbemFlagReturnImmediately flag (0x10) or no flags at all, as this ensures the resulting SWbemObjectSet collection supports .Count #include <Array.au3> #include <MsgBoxConstants.au3> Local $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") If Not IsObj($objWMIService) Then MsgBox($MB_ICONERROR, "Error", "Unable to connect to WMI service. Check privileges or WMI service status.") Exit 1 EndIf Local $sQueryNetAdapter = 'SELECT * FROM Win32_NetworkAdapter' Local $colNetAdapter = $objWMIService.ExecQuery($sQueryNetAdapter, "WQL", 0x10) ; wbemFlagReturnImmediately If Not IsObj($colNetAdapter) Then MsgBox($MB_ICONERROR, "Error", "WMI query failed. Check query syntax or access to Win32_NetworkAdapter class.") Exit 2 EndIf ; Get the number of items in the collection Local $num = $colNetAdapter.Count If @error Then MsgBox($MB_ICONERROR, "Error", "Unable to access .Count property. Error code: " & @error) Exit 3 EndIf MsgBox($MB_OK, "Number of Adapters", "Number of network adapters: " & $num) ; Create an array to store the data Local $storearray[$num][2] Local $ind = 0 For $netadapt In $colNetAdapter If IsObj($netadapt) Then $storearray[$ind][0] = Not $netadapt.Manufacturer ? "N/A" : $netadapt.Manufacturer $storearray[$ind][1] = Not $netadapt.ProductName ? "N/A" : $netadapt.ProductName $ind += 1 EndIf Next ; Display the results (for verification) For $i = 0 To $num - 1 MsgBox($MB_OK, "Adapter " & $i, "Manufacturer: " & $storearray[$i][0] & @CRLF & "Product: " & $storearray[$i][1]) Next2 points -
You can use the native WinAPI GetPrivateProfileSection. It says that : Here my take on it : #include <Array.au3> Local $aSection = IniReadSectionEx("C:\Apps\AutoIt\SQLite\Sudoku.ini", "Setting") _ArrayDisplay($aSection) Func IniReadSectionEx($sFile, $sSection, $iBuffer = 64000, $iEntry = 1000, $iLine = 100) Local $tData = DllStructCreate("byte [" & $iBuffer & "]") Local $pData = DllStructGetPtr($tData) Local $aRet = DllCall("Kernel32.dll", "int", "GetPrivateProfileSection", "str", $sSection, "struct*", $tData, "int", $iBuffer, "str", $sFile) Local $tString, $aList[$iEntry + 1][2] = [[0]], $aSplit For $i = 1 To $iEntry $tString = DllStructCreate("char string[" & $iLine & "]", $pData) $sString = $tString.string If Not $sString Then ExitLoop $aList[0][0] += 1 $aSplit = StringSplit($sString, "=", $STR_NOCOUNT) $aList[$i][0] = $aSplit[0] $aList[$i][1] = $aSplit[1] $pData += StringLen($sString) + 1 Next ReDim $aList[$i][2] Return $aList EndFunc ;==>IniReadSectionEx2 points
-
This is not true, and the second example that counts "," proves it. and this is the reason for failure2 points
-
_FileReadToArray will read a CSV test file but not the CSV file I want to read
Musashi and one other reacted to pixelsearch for a topic
You can also try the function _StringSplit2D_EX() based on @AspirinJunkie function (link in the script below) . It splits nicely "items1.csv" which has a non-fixed number of columns. #include <Array.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> Local $sFilePath = @ScriptDir & "\items1.csv" Local $sFileRead = FileRead($sFilePath) If @error Then Exit MsgBox($MB_TOPMOST, "FileRead", "@error = " & @error) Local $aRetArray = _StringSplit2D_EX($sFileRead, ",", @CRLF, True) ; True to allow a variable number of columns. If @error Then Exit MsgBox($MB_TOPMOST, "_StringSplit2D_EX", _ "@error = " & @error & @CRLF & _ "All rows don't have the same number of fields (line " & (@extended + 1) & ")") _ArrayDisplay($aRetArray, "2D array from delimited file") ;============================================== Func _StringSplit2D_EX(ByRef $sString, $sDelim_Col = "|", $sDelim_Row = @CRLF, $bExpand = False, $iAdd_EmptyCol = 0) ; based on AspirinJunkie's function _StringSplit2D found at https://autoit.de/thread/85380-1d-array-in-2d-array-splitten/ ; Thanks Nine for suggesting the 4th parameter $bExpand, to allow or not the same number of fields per row (as in _FileReadToArray) Local $a_FirstDim = StringSplit($sString, $sDelim_Row, $STR_ENTIRESPLIT + $STR_NOCOUNT) Local $iKeep_NbCol = Ubound(StringSplit($a_FirstDim[0], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT)) ; keep nb cols row 0 Local $a_Out[UBound($a_FirstDim)][1 + $iAdd_EmptyCol], $a_Line, $i_2DMax = 1 For $i = 0 To UBound($a_FirstDim) - 1 $a_Line = StringSplit($a_FirstDim[$i], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) If (Not $bExpand) And (Ubound($a_Line) <> $iKeep_NbCol) Then Return SetError(3, $i, 0) ; same error # as _FileReadToArray If UBound($a_Line) > $i_2DMax Then ; when $bExpand = False, this test will be True maximum 1 time, never more. $i_2DMax = UBound($a_Line) ReDim $a_Out[UBound($a_Out)][$i_2DMax + $iAdd_EmptyCol] EndIf For $j = 0 To UBound($a_Line) - 1 $a_Out[$i][$j] = $a_Line[$j] Next Next Return $a_Out EndFunc ;==>_StringSplit2D_EX Edit: @ioa747 & @Musashi thanks for your appreciation. I already used several times this interesting function _StringSplit2D_EX . In case you'll use it one day, I just made a minor change in it, based on the "@extended idea" described in my other post later in this thread. For example, let's run the amended script above, with : 1) items1.csv is the one from OP's 1st post (the bad csv with a non-fixed number of columns) 2) Now this line : Local $aRetArray = _StringSplit2D_EX($sFileRead, ",", @CRLF, True) ; True to expand, it allows a variable number of columns in the rows. Please change its 4th param. True to False , which means that a variable number of columns is not allowed : Local $aRetArray = _StringSplit2D_EX($sFileRead, ",", @CRLF, False) ; False doesn't expand, it means the number of columns must be the same in all rows. Now a normal message error is displayed : Please notice "line 17" in the message : this is what @extended returned, apart from @error, it helps the user to quickly point at the 1st line where the error appears. This can be interesting in case of a big file in input. For the record, the 5th optional parameter allows to add 1 or more empty columns at the right of the array, during its creation, because sometimes we need them. Well... if I added this 5th optional parameter, then you can be sure I needed it one day If you want to try the 5th parameter, just use this line in the script, it will add 5 empty columns on the right, from Col6 to Col10 Local $aRetArray = _StringSplit2D_EX($sFileRead, ",", @CRLF, True, 5) Thanks for reading2 points -
You can't, not with standard functionality of a list view . Only the item (first column) can be edited in place using $LVS_EDITLABELS. If you truly want it, you would need a workaround, like creating an input box when you dbl-click on a subitem. Here a simple example : #include <GUIConstants.au3> #include <GuiListView.au3> Opt("GUICloseOnESC", 0) Opt("MustDeclareVars", True) Global $hList, $idDummy Example() Func Example() Local $hMain = GUICreate("Example", 230, 170) Local $idList = GUICtrlCreateListView("Column 1|Column 2", 10, 10) GUICtrlCreateListViewItem("Item 1|Item 2", $idList) GUICtrlCreateListViewItem("Item 3|Item 4", $idList) $hList = GUICtrlGetHandle($idList) $idDummy = GUICtrlCreateDummy() GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY) GUISetState() Local $iItem, $iSubItem, $aRect, $sData, $aPos = ControlGetPos($hMain, "", $idList) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idDummy $iItem = _WinAPI_LoWord(GUICtrlRead($idDummy)) $iSubItem = _WinAPI_HiWord(GUICtrlRead($idDummy)) If $iSubItem = 0 Then ContinueLoop $aRect = _GUICtrlListView_GetSubItemRect($idList, $iItem, $iSubItem) $sData = GUICreateInput($hMain, _GUICtrlListView_GetItemText($idList, $iItem, $iSubItem), $aRect[0] + $aPos[0], $aRect[1] + $aPos[1], $aRect[2] - $aRect[0], $aRect[3] - $aRect[1]) If $sData Then _GUICtrlListView_SetItemText($idList, $iItem, $sData, $iSubItem) EndSwitch WEnd EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) If $tInfo.hWndFrom = $hList And $tInfo.Code = $NM_DBLCLK Then GUICtrlSendToDummy($idDummy, _WinAPI_MakeLong($tInfo.Index, $tInfo.SubItem)) Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func GUICreateInput($hWnd, $sText, $iLeft, $iTop, $iWidth, $iHeight) Local $hGUI = GUICreate("", $iWidth, $iHeight, $iLeft, $iTop + 1, $WS_POPUP, $WS_EX_MDICHILD, $hWnd) Local $idInput = GUICtrlCreateInput($sText, 0, 1, $iWidth, $iHeight - 1) Local $idOut = GUICtrlCreateDummy() GUISetState() GUISetState(@SW_DISABLE, $hWnd) Local $aAccel[2][2] = [["{ENTER}", $idInput], ["{ESC}", $idOut]], $sInput GUISetAccelerators($aAccel, $hGUI) While True Switch GUIGetMsg() Case $idInput $sInput = GUICtrlRead($idInput) ExitLoop Case $idOut ExitLoop EndSwitch WEnd GUIDelete($hGUI) GUISetState(@SW_ENABLE, $hWnd) GUISetState(@SW_RESTORE, $hWnd) Return $sInput EndFunc ;==>GUICreateInput2 points
-
my two cents, You could use WinActive() + ControlSend() to send that key to a specific window only if that window is the active one, otherwise stick with the "global" HotKey functionality Global $HotKey = '{F5}' HotKeySet("{ESC}", "Terminate") HotKeySet($HotKey, "MyHotKey") ; Run Notepad for example Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd1 = WinWait("[CLASS:Notepad]", "", 10) While 1 Sleep(100) WEnd Func MyHotKey() ; Exception for HotKey ; Perform following action(s) only if the chosen window is the active window If WinActive($hWnd1) Then ; do this only if Notepad is the active window ; send HotKey to a specific window ControlSend($hWnd1,'','', $HotKey) Return EndIf ; otherwise do standard global action ConsoleWrite($HotKey & " was pessed (outside the notepad)" & @CRLF) EndFunc Func Terminate() ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd1) ; Now a screen will pop up and ask to save the changes, the classname of the window is called ; "#32770" and simulating the "TAB" key to move to the second button in which the "ENTER" is simulated to not "save the file" WinWaitActive("[CLASS:#32770]") Sleep(500) Send("{TAB}{ENTER}") Exit EndFunc ;==>Terminate2 points
-
#Directive_If_Run
WildByDesign and one other reacted to Jos for a topic
Try the current beta v25.205.1420.11 of AutoIt3Wrapper. Added logic to strip the lines between #Autoit3Wrapper_If_* ---- #Autoit3Wrapper_(End)If(_*) that are not valid for the run and save the source to a temp file to process.2 points -
Need help removing line from dark mode menubar
ioa747 and one other reacted to WildByDesign for a topic
Thank you for the example. I've never experimented with child GUI before, so this is really quite neat. It's a very creative technique to cover up the line. I'm going to continue trying some ideas based on your example. One downside that I notice is that when you move the GUI around on the screen, it will occasionally show a flicker of the white line. I don't think that GuiCreate has any kind of double-buffer option to prevent flicker but I will try a few things to see. Thank you for your time as well. Yes, it looks like resize will definitely need some more code. There might be some differences depending on user systems' titlebar size (varying from resize and non-resize) and possibly some differences varying with DPI. I will see what I can do to measure those things.2 points -
Need help removing line from dark mode menubar
WildByDesign and one other reacted to ahmet for a topic
Here is initial version. Coordinates are wrong. I need to do other things now. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPITheme.au3> #include "GUIDarkMode_v0.02mod.au3" #include "ModernMenuRaw.au3" #include <GuiMenu.au3> #include <Array.au3> #include <WinAPIDiag.au3> #include <WinAPIConv.au3> #include <WinAPIGdiDC.au3> DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext", "HWND", "DPI_AWARENESS_CONTEXT" - 4) _SetMenuBkColor(0x202020) _SetMenuIconBkColor(0x202020) _SetMenuIconBkGrdColor(0x202020) _SetMenuSelectBkColor(0x202020) _SetMenuSelectRectColor(0x202020) _SetMenuSelectTextColor(0xFFFFFF) _SetMenuTextColor(0xFFFFFF) Example() Func Example() $hGUI = GUICreate("My GUI", 300, 200) ;Local $idFileMenu = GUICtrlCreateMenu("&File") Local $idFileMenu = _GUICtrlCreateODTopMenu("&File", $hGUI) GUICtrlCreateMenuItem("&Open", $idFileMenu) GUICtrlCreateMenuItem("&Save", $idFileMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idOptionsMenu = GUICtrlCreateMenu("O&ptions", $idFileMenu) GUICtrlCreateMenuItem("View", $idOptionsMenu) GUICtrlCreateMenuItem("", $idOptionsMenu) GUICtrlCreateMenuItem("Tools", $idOptionsMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idExitItem = GUICtrlCreateMenuItem("&Exit", $idFileMenu) ;Local $idHelpMenu = GUICtrlCreateMenu("&?") Local $idHelpMenu = _GUICtrlCreateODTopMenu("&?", $hGUI) Local $idAboutItem = GUICtrlCreateMenuItem("&About", $idHelpMenu) Local $idEndBtn = GUICtrlCreateButton("End", 110, 140, 70, 20) GuiDarkmodeApply($hGUI) GUISetState(@SW_SHOW) $aMenuBarInfo = _GUICtrlMenu_GetMenuBarInfo($hGUI, 0, 1) _ArrayDisplay($aMenuBarInfo) $rcClient = _WinAPI_GetClientRect($hGUI) _WinAPI_DisplayStruct($rcClient, $tagRECT,"rcClinet before") ;CHAT GPT Local $aCall = DllCall("user32.dll", "int", "MapWindowPoints", _ "hwnd", $hGUI, _ ; hWndFrom "hwnd", 0, _ ; hWndTo "ptr", DllStructGetPtr($rcClient), _ "uint", 2) ;number of points - 2 for RECT structure If @error Then MsgBox($MB_ICONERROR, "Error", @error) Exit EndIf _WinAPI_DisplayStruct($rcClient, $tagRECT,"rcClinet after") $rcWindow = _WinAPI_GetWindowRect($hGUI) _WinAPI_OffsetRect($rcClient, -$rcWindow.left, -$rcWindow.top) $rcAnnoyingLine = DllStructCreate($tagRECT) $rcAnnoyingLine.left = $rcClient.left $rcAnnoyingLine.top = $rcClient.top $rcAnnoyingLine.right = $rcClient.right $rcAnnoyingLine.bottom = $rcClient.bottom ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT) $rcAnnoyingLine.bottom = $rcAnnoyingLine.top $rcAnnoyingLine.top = $rcAnnoyingLine.top - 1 ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") $hDC = _WinAPI_GetDC($hGUI) $hSolidBrush=_WinAPI_CreateBrushIndirect($BS_SOLID, 0xFF00FF) _WinAPI_FillRect($hDC, $rcAnnoyingLine, $hSolidBrush) _WinAPI_ReleaseDC($hGUI, $hDC) _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $idExitItem, $idEndBtn, $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hSolidBrush) ExitLoop Case $idAboutItem MsgBox($MB_SYSTEMMODAL, "About...", "Colored menu sample") EndSwitch WEnd EndFunc ;==>Example2 points -
Technically, it can be launched separately without geckodriver, but the correct parameters need to be utilized so that it behaves the same as when launched via the webdriver. I don't remember the exact parameters, but I used to do this so I know it is possible. I think a search of the forum (and maybe the wiki) would provide the information.2 points
-
Move window behind desktop icons
argumentum and one other reacted to Parsix for a topic
I set a good challenge, it's giving good results I told @UEZ to come, he comes in like Superman 🤣2 points -
Move window behind desktop icons
argumentum and one other reacted to Parsix for a topic
Programming is a problem-solving challenge. Exactly as in the example, I need to display an image under the desktop icons, unfortunately the icons are placed under the application and cause user objections. This image could be a local calendar display. The idea of producing a unified background as suggested by "KaFu" was my first alternative solution, but I am looking for a solution to the problem as much as possible. For example, until some time ago, the code sample that "Nine" shared with the title "Create an Application Bar recognized by the system" was perhaps impossible. Nine, that code sample was very usefull, thank you very much for that code. 🥰 I did not even see a standard function or solution for sending the application to the lowest display layer, such as the functions that keep the application in the highest display layer. I'm just wondering why UEZ hasn't commented yet ?! He usually comes in with something magical like Superman.🤩😁2 points