I am trying to install Acrobat 2022 with AHKv2. A "SysTreeView32" control appears during the installation process.
I want to expand these nodes in turn and click some of their sub items (these sub items are not check boxes, but an icon that can be clicked. After clicking, it will open a shortcut menu for users to select "Install this item", "Cancel this item" or "Install this item and all its sub items"), However, AHKv2 does not seem to have a built-in function like AutoIt's "ControlTreeview" that allows me to operate such controls.
In the current situation, how can I achieve such a requirement?
Manipulating TreeView Control in AHKv2
Re: Manipulating TreeView Control in AHKv2
I’ve always had to resort to using ImageSearch to manipulate a TreeView (click “+” signs, scroll until a particular item came into view, etc.). Hopefully someone will be able to show how it can be done more directly, but at least that’s one way that I had made work.
-
- Posts: 6
- Joined: 22 Nov 2022, 04:16
Re: Manipulating TreeView Control in AHKv2
I finally solved the problem temporarily with the following code and completed the installation of Acrobat DC 2022
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Code: Select all
SetMouseDelay(300)
Run("*RunAs " A_ScriptDir "\Adobe Acrobat DC 2022 x64 SP\setup.exe")
tittle := "Adobe Acrobat DC (Continuous) - 设置"
WinWait(tittle)
WinActivate(tittle)
ControlClick("Button4", tittle)
ControlClick("Button5", tittle)
WinWait(tittle, "自定义安装")
; Click to expand the first node
ControlClick("x35 y315",tittle,,,,)
; Click to expand the next node
ControlClick("x150 y235",tittle,,,,)
; Jump to the node I need
loop 22{
Send("{Down}")
Sleep(200)
}
; Expand the menu of this node
ControlClick("x118 y480",tittle,,,,)
; Wait for the shortcut menu to expand
Sleep(200)
; Hovering the mouse over the shortcut menu helps keep the shortcut menu displayed
MouseMove(300, 510, 50)
; Select “Apply this item”
; Note that only "MouseClick" can be used here
MouseClick(, 300, 510, 50)
ControlClick("Button5", tittle, "安装(&I)")
WinWait(tittle, "安装完成")
ControlClick("Button2", tittle, "安装完成")
Exit(0)
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Re: Manipulating TreeView Control in AHKv2
For a more controlled way to manipulate an external treeview, it is better to use my RemoteTreeView class.
viewtopic.php?f=82&t=108274&hilit=treeview
viewtopic.php?f=82&t=108274&hilit=treeview
-
- Posts: 6
- Joined: 22 Nov 2022, 04:16
Re: Manipulating TreeView Control in AHKv2
@AHK_user
Great work! I'll use it to improve my code and make it work more elegantly.
Great work! I'll use it to improve my code and make it work more elegantly.