Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2025 in Posts

  1. 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
  2. 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") _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, 0, 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
    2 points
  3. This is not true, and the second example that counts "," proves it. and this is the reason for failure
    1 point
  4. Take also a look at _FileReadToArray using the $FRTA_INTARRAYS flag...
    1 point
  5. MattyD

    WinRT - WinUI3

    Hi all - This is an offshoot of the WinRT Project. I'm posting my progress here while I'm bumbling around with WinUI3 - just so the main project doesn't get too cluttered. If I get things working I'll merge the two projects back together. That's the plan anyway! Theres not much there at the moment, but if you wish to try it out you'll need to: download and extract the example (The attachment it too big for here, so I've popped it in sourceforge) Go here and download the latest Redistributable package of the Windows App SDK. Currently this is 1.7.3 (look in the table for the link.). Once you've extracted that, go to the MSIX > win10-x64 folder and install Microsoft.WindowsAppRuntime.1.7.msix It seems the x86 libraries don't work at the moment. (thanks for testing Gianni) Progress so far... Cheers, Matt
    1 point
  6. Nine

    edit ListView sub-items

    Of course, you just need to edit a few lines. #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, 1, 1, $iWidth - 1, $iHeight - 1) Local $idOut = GUICtrlCreateDummy() GUISetState() Local $aAccel[2][2] = [["{ENTER}", $idInput], ["{ESC}", $idOut]], $sInput GUISetAccelerators($aAccel, $hGUI) While WinActive($hGUI) Switch GUIGetMsg() Case $idInput $sInput = GUICtrlRead($idInput) ExitLoop Case $idOut ExitLoop EndSwitch WEnd GUIDelete($hGUI) GUISetState(@SW_RESTORE, $hWnd) Return $sInput EndFunc ;==>GUICreateInput
    1 point
×
×
  • Create New...