Leaderboard
Popular Content
Showing content with the highest reputation on 08/04/2025 in all areas
-
2 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.au32 points
-
X-Launcher_x64 - Splash Screen refuses to show despite correct code.
argumentum reacted to Jos for a topic
Also an IA formulated answer? This thread is done.1 point -
Disable or Overwrite ALT+F4
argumentum reacted to BinaryBrother for a topic
You know it's possible. GTA-V asks you if you want to quit the game when you ALT+F4. lol1 point -
1 point
-
1 point
-
Disable or Overwrite ALT+F4
argumentum reacted to Dudeguy_ for a topic
@argumentum turns out your code revealed 2 things: 1.) My coding is super bloated which isn't unprecedented as someone who's learning ( DUDE you condensed part of my code from 9 lines to 4 lines AND IMPROVED IT) 2.) I'm an idiot lol I accidentally left in a switch from an example code I pulled from and that was contributing to my issues but adding in some of you code which I knew worked correctly helped me isolate and test different sections of my code until I found the switch You're a life saver man๐๐1 point -
Help with adding to JSON file
WildByDesign reacted to ioa747 for a topic
the issue is that it already exists in the starting point , and when I put it in it again, gave me an invalid json That's why I left it outside. (for validation I use notepad++, with a 'JSON Tools' plugin that has)1 point -
Help with adding to JSON file
ioa747 reacted to WildByDesign for a topic
Thank you. This is a really neat technique as well. I learned some more from your technique as well that will benefit me. By the way, the third setting that you did not know what it is ("window.controlsStyle": "custom") is a more recent setting in latest versions of VSCode that allow custom window control buttons. In my case, it allows making them transparent and accepting of the Windows 11 backdrop materials like Mica, Acrylic, etc.1 point -
Help with adding to JSON file
WildByDesign reacted to ioa747 for a topic
I know you solved it, just for a deeper understanding, on how (I'm a rookie too) ; with string manipulation, ; the convenient point is the intermediate '},' ; which you can add before it for terminal.background ; or after it for window.customTitleBarVisibility, window.titleBarStyle Local $sTxt = '{"workbench.colorCustomizations": {"editor.background": "#00000060"}, "workbench.startupEditor": "none", "breadcrumbs.enabled": false, "window.controlsStyle": "custom", "workbench.activityBar.location": "hidden"}' ConsoleWrite($sTxt & @CRLF) Local $sNewEntry, $sNewTxt ; add terminal.background to workbench.colorCustomizations $sNewEntry = ', "terminal.background": "#00000000"' $sNewTxt = StringReplace($sTxt, '},', $sNewEntry & '},') ; * and the replace part ; add the other 2 settings ,I don't understand who the third one is, but it shouldn't have the same name. $sNewEntry = ' "window.customTitleBarVisibility": "auto","window.titleBarStyle": "custom",' $sNewTxt = StringReplace($sNewTxt, '},', '},' & $sNewEntry) ; * and the replace part ConsoleWrite($sNewTxt & @CRLF)1 point -
Help with adding to JSON file
WildByDesign reacted to AspirinJunkie for a topic
All you have to do is write the generated string to a file and tell the output function to use UTF-8 as the encoding. You can specify the encoding manually with FileOpen(), but if you address FileWrite() directly with a file name, it will automatically write the passed string to the file encoded as UTF-8 (To overwrite, delete the file before FileWrite with FileDelete). The UDF cannot handle comments in JSON because they are not standard-compliant. You already get an error when parsing with _JSON_Parse(). Therefore, there are also no comments that can be adopted in any way, so that handling these files and the UDF is therefore not intended. Perhaps a few words for basic understanding: JSON only describes how data and its hierarchy can be represented as a string. It is therefore well suited as an exchange format between different systems, as the basic data types and structures used in JSON are found in the vast majority of programming languages. It is also easy to read by humans. When working with JSON, however, this means that you only have to deal with it twice: once to convert a JSON string into the data structure of your program (_JSON_Parse) and a second time to generate a JSON string from the data structures of your program (_JSON_Generate). Everything in between (changing/adding/deleting data etc.) basically has nothing to do with JSON but simply data manipulation within the data structures in your respective program.1 point -
Help with adding to JSON file
WildByDesign reacted to AspirinJunkie for a topic
If by chance my UDF was included - I would implement it like this: #include "JSON.au3" ; your input JSON string Global $sJSONRAW = '{"workbench.startupEditor": "none","breadcrumbs.enabled": false,"window.controlsStyle": "custom","workbench.activityBar.location": "hidden"}' ; 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) ; add (or change if they already exists) the desired values ; for these values you can directly use the outer map because $vJSON is the outer map $vJSON["window.customTitleBarVisibility"] = "auto" $vJSON["window.titleBarStyle"] = "custom" ; for inner nested elements you can use _JSON_addChangeDelete() instead (points must be escaped) _JSON_addChangeDelete($vJSON, "workbench\.colorCustomizations.editor\.background", "#00000060") _JSON_addChangeDelete($vJSON, "workbench\.colorCustomizations.terminal\.background", "#00000060") ; create JSON string out of the AutoIt datastructure and print it to the console ConsoleWrite("------- Output --------- " & @CRLF & _JSON_Generate($vJSON) & @CRLF & @CRLF)1 point -
WebP v0.5.0 build 2025-08-10 beta
pixelsearch reacted to UEZ for a topic
Made major updates to the DLL and UDF and fixed (probably added new) bugs. All examples changed to new DLL / UDF. Old scripts may fail when you use DLL v0.4.3+ as function parameters changed. Added the function to convert APNG to AWEBP.1 point