possible to get information from external treeview?

Get help with using AutoHotkey and its commands and hotkeys
drizzt
Posts: 27
Joined: 20 Apr 2018, 20:44

possible to get information from external treeview?

28 Apr 2018, 18:53

I am having a great deal of difficulty trying to do the most basic task on external tree views.

all the research I have done shows only old posts from 2011 and older and lots of dead links to old AHK scripts.

other scripts show how to manipulate treeviews that were already created in AHK but this is not what I am trying to do.

at this point I would be happy to get any information at all out of an external tree view.

For example I have a program where you connect two ports together, by dragging one port which is in a treeview to another port which is in another treeview.
my final goal is to get the contents of the treeviews and locate the screen position of the port (which is burried under several parent trees)
https://imgur.com/3Achjb5
User avatar
jeeswg
Posts: 5956
Joined: 19 Dec 2016, 01:58
Location: UK

Re: possible to get information from external treeview?

29 Apr 2018, 19:13

Try this. You'll need the Acc library (see the link).

Code: Select all

;[Acc functions]
;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201

q:: ;treeview control - get item positions + text
ControlGet, hCtl, Hwnd,, SysTreeView321, A
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hCtl)
vOutput := ""
Loop, % oAcc.accChildCount
{
	oRect := Acc_Location(oAcc, A_Index)
	vAccLocation := Format("X{} Y{} W{} H{}", oRect.x, oRect.y, oRect.w, oRect.h)
	vAccName := oAcc.accName(A_Index)
	vOutput .= vAccLocation "`t" vAccName "`r`n"
}
Clipboard := vOutput
MsgBox, % "done"
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Brazolek123, evilC, Google [Bot] and 91 guests