Jump to content

Help whit Treeview


Recommended Posts

Hello everyone, sorry for my English. I have this Treewiew and the following code: 

#cs
>>>> Window <<<<
Title:  Asiento Inscripción: Inscripción 1
Class:  WindowsForms10.Window.8.app.0.a07288_r60_ad1
Position:   -8, -8
Size:   1296, 936
Style:  0x17CF0000
ExStyle:    0x00010100
Handle: 0x0000000001B20C7E

>>>> Control <<<<
Class:  WindowsForms10.Window.8.app.0.a07288_r60_ad1
Instance:   12
ClassnameNN:    WindowsForms10.Window.8.app.0.a07288_r60_ad112
Name:   treeLVariables
Advanced (Class):   [NAME:treeLVariables]
ID: 40632432
Text:
Position:   786, 321
Size:   485, 539
ControlClick Coords:    104, 164
Style:  0x56010000
ExStyle:    0x00000000
Handle: 0x00000000026C0070

>>>> Mouse <<<<
Position:   890, 508
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
52236415: UCEditorView
Variables
23935809: UCTreeVariablesView
Variables
Búsqueda
Texto largo
Descripción


>>>> Hidden Text <<<<
#ce

Func click()
    WinActivate("[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1]", "")
    $hTreeView = ControlGetHandle("", "", "[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1; INSTANCE:12]")
    ConsoleWrite ( "Handle TreeView " & $hTreeView & @CRLF)
    _GUICtrlTreeView_Expand($hTreeView, 0, False)
    $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "BLOQUE")
    ConsoleWrite ( "Item Found " & $hItemFound & @CRLF)
    _GUICtrlTreeView_SelectItem($hTreeView,$hItemFound)
    _GUICtrlTreeView_ClickItem($hTreeView, $hItemFound, "left", False, 2)
EndFunc

The code doesn't work, could you help me with it?

image.thumb.png.8a802f9aa8ee4b1e5a52630a3130136c.png

Link to comment
Share on other sites

Func click()
    $hWnd = WinActivate("[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1]", "")
    ConsoleWrite("$hWnd=" & $hWnd & @CRLF)
    $hTreeView = ControlGetHandle($hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1; INSTANCE:12]")
    ConsoleWrite("Handle TreeView " & $hTreeView & @CRLF)
    _GUICtrlTreeView_Expand($hTreeView, 0, False)
    $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "BLOQUE")
    ConsoleWrite("Item Found " & $hItemFound & @CRLF)
    _GUICtrlTreeView_SelectItem($hTreeView, $hItemFound)
    _GUICtrlTreeView_ClickItem($hTreeView, $hItemFound, "left", False, 2)
EndFunc   ;==>click

does the console return the values? which ones?


Edit:
it doesn't look like an ordinary TreeView32

 

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

try with
https://www.autoitscript.com/autoit3/docs/functions/ControlTreeView.htm

like

$sTViewPath = "one|two|three"

Local $aPath = StringSplit($sTViewPath, "|", 1)
Local $tmpPath = ""
For $i = 1 To $aPath[0]
    $tmpPath &= $aPath[$i] & "|"
    ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF)
    ControlTreeView($hWnd, "", $hTreeView, "Expand", StringTrimRight($tmpPath, 1))
    ControlTreeView($hWnd, "", $hTreeView, "Select", StringTrimRight($tmpPath, 1))
    Sleep(50)
Next

 

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

Thanks, but not work

$hWnd = WinActivate("[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1]", "")
$hTreeView = ControlGetHandle($hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1; INSTANCE:12]")
$hItemFound = ControlTreeView ( $hTreeView, "treeLVariables", "[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1; INSTANCE:12]", "GetItemCount" , "#1|#2")
ConsoleWrite("Item Found " & $hItemFound & @CRLF)

any idea ??

Link to comment
Share on other sites

$hWnd = WinActivate("[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1]", "")
$hTreeView = ControlGetHandle($hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.a07288_r60_ad1; INSTANCE:12]")
ControlTreeView ( $hWnd, "", $hTreeView, "Expand" , "#0")
ControlTreeView ( $hWnd, "", $hTreeView, "Select" , "#0")
Sleep(50)

$iItemCnt = ControlTreeView ( $hWnd, "", $hTreeView, "GetItemCount" , "#0")
ConsoleWrite("Item Count " & $iItemCnt & @CRLF)

 

Edited by ioa747
correction

I know that I know nothing

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...