Jump to content
Sign in to follow this  
h711

How to controlclick an item in CLASS:SysList View32?

Recommended Posts

h711

Hi, I try to auto an installer. On one page, there is a list box with 3 items in it. How do I select one of these items?

I use AutoIt V3 Window Info to scan the box, but it can only give me infor about this box, but not the items listed in the box.

Control

Class SysListView32

Instance 1

ClassnameNN SysListView321

Advanced(Class) [CLASS:SysListView32;INSTANCE:1]

ID 1050

Test List1

Thanks for the help!

Share this post


Link to post
Share on other sites
spudw2k
spudw2k

Share this post


Link to post
Share on other sites
h711

Thanks!!!

Share this post


Link to post
Share on other sites
h711

I need some help for this. I used ControlCommand to wait until the listbox finishs searching all deviceds. This part is fine. The problem is, the _GUICtrlListView_SetItemSelected did not work as I wished. For this simple test, I want the automation to select and focus on the second item in the list box. The problem is, sometime the second item is selected, some time is focused, but it's kind random. If I manually use my mouse to click one of the items, the "Next" button will be enabled. But this script never enabled the "next" button.

There must be something wrong with this code, please help me. Thanks!

Do
  Sleep(50)
Until ControlCommand("Installation Wizard", "", "[CLASS:Button; INSTANCE:10]", "IsEnabled")

$h = WinGetHandle("[CLASS:SysListView32]")
$hwnd = ControlGetHandle($h,"","SysListView321")
_GUICtrlListView_SetItemSelected($hwnd,1, true, true)
Edited by h711

Share this post


Link to post
Share on other sites
PsaltyDS

I need some help for this. I used ControlCommand to wait until the listbox finishs searching all deviceds. This part is fine. The problem is, the _GUICtrlListView_SetItemSelected did not work as I wished. For this simple test, I want the automation to select and focus on the second item in the list box. The problem is, sometime the second item is selected, some time is focused, but it's kind random. If I manually use my mouse to click one of the items, the "Next" button will be enabled. But this script never enabled the "next" button.

There must be something wrong with this code, please help me. Thanks!

Do
  Sleep(50)
Until ControlCommand("Installation Wizard", "", "[CLASS:Button; INSTANCE:10]", "IsEnabled")

$h = WinGetHandle("[CLASS:SysListView32]")
$hwnd = ControlGetHandle($h,"","SysListView321")
_GUICtrlListView_SetItemSelected($hwnd,1, true, true)
Setting the item as selected does not trigger the onclick event for it, which is what the app detects when you click on it. Try _GUICtrlListView_ClickItem() after setting the selection with _GUICtrlListView_SetItemSelected().

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
BbIXyXOJIb

Hello

There's SysListView32 and I want select item in it not by order. For example, in windows if there is an item in list called "printer" and I'm typing "pri" - the item "printer" will be selected according to this letters. How can I do this using AutoIt?

Share this post


Link to post
Share on other sites
Rishav

how about selecting the list view using the above mentioned commands. then send Pg Up to ensure the top most item is selected. then send "printer" finally click the selected item.

Share this post


Link to post
Share on other sites
BbIXyXOJIb

Thanks a lot, doing such way:

$h = WinGetHandle("[CLASS:SysListView32]")
$hwnd = ControlGetHandle($h,"","SysListView321")
_GUICtrlListView_SetItemSelected($hwnd,1, true, true)   
ControlSend("Мастер установки оборудования", "", $hwnd, "{PGUP}")
ControlSend("Мастер установки оборудования", "", $hwnd, "{ASC 8079}{ASC 8160}{ASC 9128}")

for non-english captions does what I need. String has to be send in unicode.

Share this post


Link to post
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
Sign in to follow this  

×