Sign in to follow this  
Followers 0
Guest patchman

Selecting from a ListView

2 posts in this topic

Hi all,

I am very new to scripting with AutoIT and think its the best scripting language i've ever used.

Anyway, i have a problem, i am creating an automated install script for a program we are installing in our office.

Halfway through the install, you can select a couple of programs to install from a List.

I have 'selected the product i want to install from the list, but it does not show as being selected (gets hilighted in blue).

Code is as follows...

;Select System Management Display and SafeView and then click Install Package
WinWaitActive("Software Installation - Package Selection")
ControlCommand("Software Installation - Package Selection", "", "ListBox1", "SelectString", "SafeView")

Can someone please help? Because it isn't hilighted, the button that says install is still greyed out. I tried enabling the button but the installer detects that nothing is selected.

Cheers

Share this post


Link to post
Share on other sites



Try the following

Global Const $LB_SETSEL = 0x0185

$h_listbox = ControlGetHandle("Software Installation - Package Selection", "","ListBox1")
$i_ret = DllCall("user32.dll","int","SendMessage","hwnd",$h_listbox,"int",$LB_SETSEL,"int", 1, "int", $i_index)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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  
Followers 0