Leaderboard
Popular Content
Showing content with the highest reputation on 08/31/2025 in all areas
-
UDF: #include-once #cs ---------------------------------------------------------------------------- ; LZNT1 Compression ; AutoIt Version: 3.3.16.1+ ; Description: Supports compression and decompression of binary data and strings using the Windows LZNT1 algorithm. ; Author: trancexx + rewritten & extended by Dao Van Trong - TRONG.PRO ; ; Functions: ; _LZNT_Compress($bInput, $iEngine = 2, $bBase64 = False, $iLineLen = 1024) ; _LZNT_Decompress($vInput, $iOrigSize = 0, $iEngine = 2, $bBase64 = False) ; _LZNT_CompressString($sInput, $iEncoding = 4, $iEngine = 2, $bBase64 = False, $iLineLen = 1024) ; _LZNT_DecompressString($vInput, $iOrigSize = 0, $iEncoding = 4, $iEngine = 2, $bBase64 = False) ; #ce ---------------------------------------------------------------------------- ; =============================================================================================================================== ; Public Function: Compress Binary ; =============================================================================================================================== ; Description: Compresses binary data using the LZNT1 algorithm. ; Parameters: ; $bInput - Binary data to be compressed. ; $iEngine - Compression engine. ; 2 (default) = COMPRESSION_FORMAT_LZNT1 | $COMPRESSION_ENGINE_STANDARD ; 258 = COMPRESSION_ENGINE_MAXIMUM ; $bBase64 - True to return a Base64 string, False to return binary data. ; $iLineLen - Line length when returning a Base64 string (default is 1024 characters). ; Return Value: Returns the compressed data (binary or Base64). ; On Failure: Returns an empty string (""), @error is set to: ; 1 = Error calling RtlGetCompressionWorkSpaceSize. ; 2 = Error calling RtlCompressBuffer. ; 3 = Error converting to Base64 in __Base64Encode. ; @extended is set to the original length of the binary data. ; Author: Dao Van Trong - TRONG.PRO ; =============================================================================================================================== Func _LZNT_Compress($bInput, $iEngine = 2, $bBase64 = False, $iLineLen = 1024) If Not IsBinary($bInput) Then $bInput = Binary($bInput) If $iEngine <> 2 And $iEngine <> 258 Then $iEngine = 2 Local $tInput = DllStructCreate("byte[" & BinaryLen($bInput) & "]") DllStructSetData($tInput, 1, $bInput) Local $aCall = DllCall("ntdll.dll", "int", "RtlGetCompressionWorkSpaceSize", _ "ushort", $iEngine, "dword*", 0, "dword*", 0) If @error Or $aCall[0] Then Return SetError(1, 0, "") Local $tWork = DllStructCreate("byte[" & $aCall[2] & "]") Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") $aCall = DllCall("ntdll.dll", "int", "RtlCompressBuffer", _ "ushort", $iEngine, _ "ptr", DllStructGetPtr($tInput), "dword", DllStructGetSize($tInput), _ "ptr", DllStructGetPtr($tBuffer), "dword", DllStructGetSize($tBuffer), _ "dword", 4096, "dword*", 0, "ptr", DllStructGetPtr($tWork)) If @error Or $aCall[0] Then Return SetError(2, 0, "") Local $tOut = DllStructCreate("byte[" & $aCall[7] & "]", DllStructGetPtr($tBuffer)) Local $bOut = DllStructGetData($tOut, 1) If $bBase64 Then Return SetError(0, DllStructGetSize($tInput), __Base64Encode($bOut, $iLineLen)) Return SetError(0, DllStructGetSize($tInput), $bOut) EndFunc ;==>_LZNT_Compress ; =============================================================================================================================== ; Public Function: Decompress Binary ; =============================================================================================================================== ; Description: Decompresses LZNT1-compressed binary data. ; Parameters: ; $vInput - Compressed data, can be binary or a Base64 string. ; $iOrigSize - Estimated original size of the uncompressed data. If < 1, it will be estimated automatically. ; $iEngine - Compression engine used. ; 2 (default) = COMPRESSION_FORMAT_LZNT1 | $COMPRESSION_ENGINE_STANDARD ; 258 = COMPRESSION_ENGINE_MAXIMUM ; $bBase64 - True if $vInput is a Base64 string, False if it is binary data. ; Return Value: Returns the decompressed binary data. ; On Failure: Returns an empty string (""), @error is set to: ; 1 = Decompression error, or $vInput is not Base64 when $bBase64 is True. ; @extended is set to 0. ; Author: Dao Van Trong - TRONG.PRO ; =============================================================================================================================== Func _LZNT_Decompress($vInput, $iOrigSize = 0, $iEngine = 2, $bBase64 = False) Local $bInput If $bBase64 Then $bInput = __Base64Decode($vInput) Else $bInput = $vInput EndIf If Not IsBinary($bInput) Then $bInput = Binary($bInput) If $iEngine <> 2 And $iEngine <> 258 Then $iEngine = 2 Local $tInput = DllStructCreate("byte[" & BinaryLen($bInput) & "]") DllStructSetData($tInput, 1, $bInput) If $iOrigSize < 1 Then $iOrigSize = 16 * DllStructGetSize($tInput) Local $tBuffer = DllStructCreate("byte[" & $iOrigSize & "]") Local $aCall = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _ "ushort", $iEngine, _ "ptr", DllStructGetPtr($tBuffer), "dword", DllStructGetSize($tBuffer), _ "ptr", DllStructGetPtr($tInput), "dword", DllStructGetSize($tInput), _ "dword*", 0) If @error Or $aCall[0] Then Return SetError(1, 0, "") Local $tOut = DllStructCreate("byte[" & $aCall[6] & "]", DllStructGetPtr($tBuffer)) Return SetError(0, $aCall[6], DllStructGetData($tOut, 1)) EndFunc ;==>_LZNT_Decompress ; =============================================================================================================================== ; Public Function: Compress String ; =============================================================================================================================== ; Description: Compresses a string and returns the compressed data. ; Parameters: ; $sInput - String to be compressed. ; $iEncoding - String encoding. (1=ANSI, 2=UTF16LE, 3=UTF16BE, 4=UTF8) ; $iEngine - Compression engine (same as _LZNT_Compress).(2 or 258) ; $bBase64 - True to return a Base64 string, False to return binary. ; $iLineLen - Line length when returning a Base64 string. ; Return Value: Returns the compressed data (binary or Base64). ; On Failure: Returns an empty string (""), @error is set to: ; 1, 2, 3 (same as _LZNT_Compress). ; @extended is set to the original length of the string data. ; Author: Dao Van Trong - TRONG.PRO ; =============================================================================================================================== Func _LZNT_CompressString($sInput, $iEncoding = 4, $iEngine = 2, $bBase64 = False, $iLineLen = 1024) Local $bData = StringToBinary($sInput, $iEncoding) Return _LZNT_Compress($bData, $iEngine, $bBase64, $iLineLen) EndFunc ;==>_LZNT_CompressString ; =============================================================================================================================== ; Public Function: Decompress String ; =============================================================================================================================== ; Description: Decompresses data and returns a string. ; Parameters: ; $vInput - Compressed data. ; $iOrigSize - Estimated original size of the uncompressed data. ; $iEncoding - Encoding to convert the decompressed binary to a string. (1=ANSI, 2=UTF16LE, 3=UTF16BE, 4=UTF8) ; $iEngine - Compression engine used (same as _LZNT_Decompress).(2 or 258) ; $bBase64 - True if $vInput is a Base64 string, False if it is binary. ; Return Value: Returns the decompressed string. ; On Failure: Returns an empty string (""), @error is set to: ; 1 = Decompression error (same as _LZNT_Decompress). ; @extended is set to 0. ; Author: Dao Van Trong - TRONG.PRO ; =============================================================================================================================== Func _LZNT_DecompressString($vInput, $iOrigSize = 0, $iEncoding = 4, $iEngine = 2, $bBase64 = False) Local $bData = _LZNT_Decompress($vInput, $iOrigSize, $iEngine, $bBase64) If @error Then Return SetError(1, 0, "") Return BinaryToString($bData, $iEncoding) EndFunc ;==>_LZNT_DecompressString ; =============================================================================================================================== ; Internal helper: Base64 Encode ; =============================================================================================================================== Func __Base64Encode($bData, $iLineLen = 1024) If Not IsBinary($bData) Then Return SetError(1, 0, "") Local $pInput = DllStructCreate("byte[" & BinaryLen($bData) & "]") DllStructSetData($pInput, 1, $bData) ; 1st call to get required length Local $aCall = DllCall("Crypt32.dll", "bool", "CryptBinaryToStringW", _ "ptr", DllStructGetPtr($pInput), _ "dword", DllStructGetSize($pInput), _ "dword", 0x1, _ ; CRYPT_STRING_BASE64 "ptr", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(2, 0, "") Local $iLen = $aCall[5] Local $tOut = DllStructCreate("wchar[" & $iLen & "]") ; 2nd call to actually encode $aCall = DllCall("Crypt32.dll", "bool", "CryptBinaryToStringW", _ "ptr", DllStructGetPtr($pInput), _ "dword", DllStructGetSize($pInput), _ "dword", 0x1, _ "ptr", DllStructGetPtr($tOut), _ "dword*", $iLen) If @error Or Not $aCall[0] Then Return SetError(3, 0, "") Local $sOut = DllStructGetData($tOut, 1) ; Remove CRLF inserted by Crypt32 $sOut = StringReplace($sOut, @CRLF, "") ; Manual wrap for embedding in AutoIt source If $iLineLen > 0 And StringLen($sOut) > $iLineLen Then Local $sWrapped = "" For $i = 1 To StringLen($sOut) Step $iLineLen $sWrapped &= StringMid($sOut, $i, $iLineLen) & @CRLF Next $sOut = StringTrimRight($sWrapped, 2) EndIf Return $sOut EndFunc ;==>__Base64Encode ; =============================================================================================================================== ; Internal helper: Base64 Decode ; =============================================================================================================================== Func __Base64Decode($sBase64) If Not IsString($sBase64) Then Return SetError(1, 0, "") ; strip whitespace / CRLF $sBase64 = StringStripWS($sBase64, 8) ; 1st call to get required length Local $aCall = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryW", _ "wstr", $sBase64, _ "dword", 0, _ "dword", 0x1, _ ; CRYPT_STRING_BASE64 "ptr", 0, _ "dword*", 0, _ "dword*", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(2, 0, "") Local $iLen = $aCall[5] Local $tOut = DllStructCreate("byte[" & $iLen & "]") ; 2nd call to decode $aCall = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryW", _ "wstr", $sBase64, _ "dword", 0, _ "dword", 0x1, _ "ptr", DllStructGetPtr($tOut), _ "dword*", $iLen, _ "dword*", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(3, 0, "") Return DllStructGetData($tOut, 1) EndFunc ;==>__Base64Decode #cs ; =============================================================================================================================== ; SELF-TEST FOR LZNT + BASE64 UDF ; =============================================================================================================================== ; Test string with 10 languages Global Const $sTest = "Hello 你好 नमस्ते Hola Bonjour مرحبا হ্যালো Привет Olá Xin chào 🚀" ConsoleWrite("!===== SELF TEST START =====" & @CRLF) ConsoleWrite("+ Original String: " & $sTest & @CRLF) ConsoleWrite("- Original Length: " & StringLen($sTest) & " chars" & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 1) Compress binary ; ------------------------------------------------------------------------------------------------------------------------------- Local $bInput = StringToBinary($sTest, 4) ; UTF-8 Local $bCompressed = _LZNT_Compress($bInput, 2, False) Local $iOrigSize = @extended ConsoleWrite(@CRLF & "- [1] Compress Binary (HEX)" & @CRLF) ConsoleWrite("+ OrigSize: " & $iOrigSize & " CompressedSize: " & BinaryLen($bCompressed) & @CRLF) ; Decompress binary Local $bDecompressed = _LZNT_Decompress($bCompressed, $iOrigSize, 2, False) ConsoleWrite("" & (BinaryToString($bDecompressed, 4) = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 2) Compress binary + Base64 ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedB64 = _LZNT_Compress($bInput, 2, True, 32) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [2] Compress Binary (Base64)" & @CRLF) ConsoleWrite("+ Compressed (B64): " & @CRLF & $sCompressedB64 & @CRLF) ; Decompress binary from Base64 $bDecompressed = _LZNT_Decompress($sCompressedB64, $iOrigSize, 2, True) ConsoleWrite("" & (BinaryToString($bDecompressed, 4) = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 3) Compress String (HEX) ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedStr = _LZNT_CompressString($sTest, 4, 2, False) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [3] Compress String (HEX)" & @CRLF) ConsoleWrite("+ CompressedSize: " & BinaryLen($sCompressedStr) & @CRLF) ; Decompress String Local $sDecompressed = _LZNT_DecompressString($sCompressedStr, $iOrigSize, 4, 2, False) ConsoleWrite("- Decompressed String: " & $sDecompressed & @CRLF) ConsoleWrite("" & ($sDecompressed = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 4) Compress String (Base64) ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedStrB64 = _LZNT_CompressString($sTest, 4, 2, True, 40) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [4] Compress String (Base64)" & @CRLF) ConsoleWrite("+ Compressed (B64): " & @CRLF & $sCompressedStrB64 & @CRLF) ; Decompress String $sDecompressed = _LZNT_DecompressString($sCompressedStrB64, $iOrigSize, 4, 2, True) ConsoleWrite("- Decompressed String: " & $sDecompressed & @CRLF) ConsoleWrite("" & ($sDecompressed = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ConsoleWrite("!===== SELF TEST END =====" & @CRLF) #ce EG: ;#include "LZNT_Compress_Engine.AU3" ; =============================================================================================================================== ; SELF-TEST FOR LZNT + BASE64 UDF ; =============================================================================================================================== ; Test string with 10 languages Global Const $sTest = "Hello 你好 नमस्ते Hola Bonjour مرحبا হ্যালো Привет Olá Xin chào 🚀" ConsoleWrite("!===== SELF TEST START =====" & @CRLF) ConsoleWrite("+ Original String: " & $sTest & @CRLF) ConsoleWrite("- Original Length: " & StringLen($sTest) & " chars" & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 1) Compress binary ; ------------------------------------------------------------------------------------------------------------------------------- Local $bInput = StringToBinary($sTest, 4) ; UTF-8 Local $bCompressed = _LZNT_Compress($bInput, 2, False) Local $iOrigSize = @extended ConsoleWrite(@CRLF & "- [1] Compress Binary (HEX)" & @CRLF) ConsoleWrite("+ OrigSize: " & $iOrigSize & " CompressedSize: " & BinaryLen($bCompressed) & @CRLF) ; Decompress binary Local $bDecompressed = _LZNT_Decompress($bCompressed, $iOrigSize, 2, False) ConsoleWrite("" & (BinaryToString($bDecompressed, 4) = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 2) Compress binary + Base64 ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedB64 = _LZNT_Compress($bInput, 2, True, 32) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [2] Compress Binary (Base64)" & @CRLF) ConsoleWrite("+ Compressed (B64): " & @CRLF & $sCompressedB64 & @CRLF) ; Decompress binary from Base64 $bDecompressed = _LZNT_Decompress($sCompressedB64, $iOrigSize, 2, True) ConsoleWrite("" & (BinaryToString($bDecompressed, 4) = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 3) Compress String (HEX) ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedStr = _LZNT_CompressString($sTest, 4, 2, False) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [3] Compress String (HEX)" & @CRLF) ConsoleWrite("+ CompressedSize: " & BinaryLen($sCompressedStr) & @CRLF) ; Decompress String Local $sDecompressed = _LZNT_DecompressString($sCompressedStr, $iOrigSize, 4, 2, False) ConsoleWrite("- Decompressed String: " & $sDecompressed & @CRLF) ConsoleWrite("" & ($sDecompressed = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ; ------------------------------------------------------------------------------------------------------------------------------- ; 4) Compress String (Base64) ; ------------------------------------------------------------------------------------------------------------------------------- Local $sCompressedStrB64 = _LZNT_CompressString($sTest, 4, 2, True, 40) $iOrigSize = @extended ConsoleWrite(@CRLF & "- [4] Compress String (Base64)" & @CRLF) ConsoleWrite("+ Compressed (B64): " & @CRLF & $sCompressedStrB64 & @CRLF) ; Decompress String $sDecompressed = _LZNT_DecompressString($sCompressedStrB64, $iOrigSize, 4, 2, True) ConsoleWrite("- Decompressed String: " & $sDecompressed & @CRLF) ConsoleWrite("" & ($sDecompressed = $sTest ? '- Decompressed OK' : '! Decompressed NG') & @CRLF) ConsoleWrite("!===== SELF TEST END =====" & @CRLF) #ce !3 points
-
Make a symbols of '1st 2nd 3rd 4th'
argumentum reacted to jchd for a topic
No, its a small greek letter phi (φ). I was also surprised it existed. Got that source from @Nine (above) but didn't correctly check. Code fixed.1 point -
1 point
-
Make a symbols of '1st 2nd 3rd 4th'
ioa747 reacted to argumentum for a topic
GUICtrlSetFont(-1, 24, 600, 0, 'Consolas') ; <<-- This font shows better superscript --<< ...these people ain't gonna show up, but I liked the post1 point -
For the fun (single creation with Static and Map). No need to check, map will do it for you (see last ex). #include <Constants.au3> MsgBox($MB_OK, "Test 1", "1" & Sup("st")) MsgBox($MB_OK, "Test 2", "3" & Sup("rd")) MsgBox($MB_OK, "Last", "e = mc" & Sup("2*()")) Func Sup($sString) Local Static $sText = "abcdefghijklmnopqrstuvwxyz0123456789" Local Static $sSup = "ᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻ⁰¹²³⁴⁵⁶⁷⁸⁹" Local Static $mSup[], $bCreated = False If Not $bCreated Then For $i = 1 To StringLen($sText) $mSup[StringMid($sText, $i, 1)] = StringMid($sSup, $i, 1) Next $bCreated = True EndIf Local $sRep For $i = 1 To StringLen($sString) $sRep &= $mSup[StringMid($sString, $i, 1)] Next Return $sRep EndFunc ;==>Sup1 point
-
WinRT - WinUI3
WildByDesign reacted to MattyD for a topic
Last time we left this, we were looking at how to attach a button to a grid spot: The first task is to associate the button with the grid - which is done via the grid's IPanel::GetChildren. Calling that gives us a Microsoft.UI.Xaml.Controls.UIElementCollection, which is navigated exactly the same way as the earlier collections we looked at. We can just "Append" the button. Interestingly enough, there's no need to switch over to the button's IUIElement interface before adding it to the collection. _WinRT_SwitchInterface($pGrid, $sIID_IPanel) Local $pGridChildren = IPanel_GetChildren($pGrid) IVector_Append($pGridChildren, $pButton) Just adding the button as child of the grid caused it to appear in row 0 ,column 0 - which was a pleasant surprise! So now we need to try and move it. Remember that example XAML? We need to access those attached "Grid.Column" and "Grid.Row" properties on the button. The documentation on attached properties essentially tells us how this should be done. <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button x:Name="btn1" Grid.Column="1" Grid.Row="1" Content="Click Me" Click="ClickFunc" /> </Grid> The example in the documentation is for something slightly different, but the concept is the same: (they are attaching the canvas.TopProperty to a checkbox, we're attaching "Grid.Row" to a button) Canvas myC = new Canvas(); CheckBox myCheckBox = new CheckBox(); myCheckBox.Content = "Hello"; myC.Children.Add(myCheckBox); myCheckBox.SetValue(Canvas.TopProperty,75); Going line by line through that, It looks like we've done everything but the last line for our implementation. And to progress we'll first need to get a representation of the property. In the explorer, we can find a "get_RowProperty" on the IGridStatics interface. TypeDef : Microsoft.UI.Xaml.Controls.IGridStatics GUID : {EF9CF81D-A431-50F4-ABF5-3023FE447704} Exclusive To : Microsoft.UI.Xaml.Controls.Grid etc... ------------------------------------------------------------ Method : get_RowProperty Fn : value = get_RowProperty() P0 : value type: Microsoft.UI.Xaml.DependencyProperty Statics interfaces live on factories, so we need to jump on $pGrid_Fact to get our properties. _WinRT_SwitchInterface($pGrid_Fact, $sIID_IGridStatics) Local Static $pGridRowProp = IGridStatics_GetRowProperty($pGrid_Fact) Local Static $pGridColProp = IGridStatics_GetColumnProperty($pGrid_Fact) Next, we see on the child object (the button) that there is a SetValue method on IDependencyObject TypeDef : Microsoft.UI.Xaml.IDependencyObject GUID : {E7BEAEE7-160E-50F7-8789-D63463F979FA} Exclusive To : Microsoft.UI.Xaml.DependencyObject Property : Dispatcher Property : DispatcherQueue Method : GetValue Fn : result = GetValue(In dp) P0 : result type: System.Object P1 : dp type: Microsoft.UI.Xaml.DependencyProperty Method : SetValue Fn : SetValue(In dp, In value) P0 : result type: void P1 : dp type: Microsoft.UI.Xaml.DependencyProperty P2 : value type: System.Object We need an Microsoft.UI.Xaml.DependencyProperty, and we have a Microsoft.UI.Xaml.DependencyProperty. So happy days. Now we need a "value" param for setValue - and that's of type System.Object 😮. We should have a good idea whats been asked of us though based on our earlier adventure with setting button text.. But unlike before, we can just call "getValue" to see what we need. _WinRT_SwitchInterface($pButton, $sIID_IDependencyObject) Local $pValue = IDependencyObject_GetValue($pButton, $pRowProp) _WinRT_DisplayInterfaces($pValue) And huh? (291,0) Supported Interfaces: Class: Windows.Foundation.IReference`1<Int32> {4BD682DD-7554-40E9-9A9B-82654EDE7E62} - IPropertyValue {00000038-0000-0000-C000-000000000046} - IWeakReferenceSource {548CEFBD-BC8A-5FA0-8DF2-957440FC8BF4} we get IReference`1<Int32> - I was expecting Windows.Foundation.PropertyValue... We can see we have an IPropertyValue interface - so maybe this is just what an instantiated propertyValue looks like when wrapping an integer... Local $pRowAddress = IPropertyValueStatics_CreateInt32($pProp_Fact, 1) _WinRT_DisplayInterfaces($pRowAddress) And yes, the above code returns the same thing - So continuing on! Local $pRowAddress = IPropertyValueStatics_CreateInt32($pProp_Fact, 1) Local $pColAddress = IPropertyValueStatics_CreateInt32($pProp_Fact, 1) IDependencyObject_SetValue($pButton, $pRowProp, $pRowAddress) IDependencyObject_SetValue($pButton, $pColProp, $pColAddress) Then we can finally see our handiwork!1 point -
Alrighty, here's a couple of general notes around this attachment, then there will be a follow up post with more detail around the Grid stuff. (last one for the weekend I promise!) We can now include "Include\WinRT_WinUI3.au3" which exposes _WinUI3_Startup and _WinUI3_Shutdown. This is basically those boostrapper calls to spin up and down the runtime. In WinRT.au3, I've popped _WinRT_SwitchInterface in as a standard func so we don't have to do multi-step calls through IUnknown to jump between interfaces. I've also added a _WinRT_CreateDelegate() and _WinRT_DestroyDelegate() in WinRT.au3 to do the heavy lifting for creating delegates. So the syntax now looks like this: ; Creation $pBtnClickDelegate = _WinRT_CreateDelegate("BtnClick") $iBtnClickHandlerTkn = IButtonBase_AddHdlrClick($pButton, $pBtnClickDelegate) ; Teardown IButtonBase_RemoveHdlrClick($pButton, $iBtnClickHandlerTkn) _WinRT_DestroyDelegate($pBtnClickDelegate) Func BtnClick($pThis, $pSender, $pArgs) ;Do stuff EndFunc I'll still need to fix up a few more things before popping this all up on sourceforge - but just thought I'd get these quality of life things out the door while I'm feeling energetic! WindowTest - Grid.zip1 point
-
That's only true for the 32bit version of AutoIt running on x64. If you run the native x64 version you are on your own1 point
-
Added more (all?) cases of infinities, indeterminates and clarified NANs (Not A Number) categories.0 points