Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

How to Select Deselect Options in Combo List?

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Dislocated Time

Dislocated Time

    Member

  • Member
  • PipPip
  • 106 posts
  • Joined 02-November 07
Hi.

I've been recording my installations with AutoIt and have come across one problem.

During recording, I'll click a combo box to select it.

When I test my scripts, the combo boxes are already selected, because windows somehow remembers what was selected and then DEselects them.

Is there any way to use some send command to make absolutely sure that certain boxes are selected or deselected?

I have been able to find anything understandable or usable in the help file.
Shift happens, Magic happens too...


How to remove advertisement from MSFN

#2
bj-kaiser

bj-kaiser

    Advanced Member

  • Member
  • PipPipPip
  • 415 posts
  • Joined 05-December 06
  • OS:Windows 7 x86
  • Country: Country Flag
http://www.autoitscr...trolCommand.htm

try using "SelectString".
"Hello IT. Have you tried turning it off and on again?" -- Roy, The IT Crowd

#3
Dislocated Time

Dislocated Time

    Member

  • Member
  • PipPip
  • 106 posts
  • Joined 02-November 07
Do you have an example where that works?

That's one of the things that I don't so much like about AutoIt... there are simply not enough examples... I have spent hours trying out possibilities out before anything really works.

Let me reiterate a little bit so that some of you might understand my dilemma.

Here's an example:

AutoIt v3 Window Info "Summary":
>>>> Window <<<<
Title: Setup - TUGZip
Class: TWizardForm
*snip*

>>>> Control <<<<
Class: TNewCheckListBox
Instance: 1
ClassnameNN: TNewCheckListBox1
Advanced (Class): [CLASS:TNewCheckListBox; INSTANCE:1]
ID: 919194<<<<<This here keeps changing whenever I rerun the script so I can't use ControlClick on it correctly
Text:
Position: 40, 109
Size: 417, 192
ControlClick Coords: 91, 61
Style: 0x54010161
ExStyle: 0x00000000
Handle: 0x000E069A

>>>> Mouse <<<<
Position: 394, 357
Cursor ID: 0
Color: 0xD6D3CE

>>>> StatusBar <<<<

>>>> Visible Text <<<<
Select Additional Tasks
Which additional tasks should be performed?
Select the additional tasks you would like Setup to perform while installing TUGZip, then click Next.
< &Back
&Next >
Cancel


>>>> Hidden Text <<<<
Setup will create the program's shortcuts in the following Start Menu folder.
To continue, click Next. If you would like to select a different folder, click Browse.
TUGZip
B&rowse...
&Don't create a Start Menu folder
Setup will install TUGZip into the following folder.
To continue, click Next. If you would like to select a different folder, click Browse.
D:\Program Files\Tugzip
B&rowse...
At least 15.8 MB of free disk space is required.
Please read the following License Agreement. You must accept the terms of this agreement before continuing with the installation.

The dilemma is, that there are 3 options in this menu which are not listed in this summary:
1. Create a desktop icon
2. Create a quicklaunch icon
3. Don't display the configuration wizard when Tugzip is launched for the first time.

For the first two options, I can use the Send("{!q}") or Send("{!d}") commands, but the third has no ALT command with which I can work.

When I use the mouse to checkmark any of the boxes and then do an install in my virtual workstation, it keeps that information and remembers it for this PC, but when I install it on another PC, the checkmarks in that checklist are missing or inverted.

Edited by Dislocated Time, 11 August 2008 - 01:38 PM.

Shift happens, Magic happens too...

#4
blinkdt

blinkdt

    Somewhat Knowledgeable

  • Member
  • PipPipPipPip
  • 582 posts
  • Joined 30-September 03
  • OS:Windows 8 x64
  • Country: Country Flag
Here's how I adjust visual settings using AutoIt:
TrayTip('Unattended Installation', 'Adjusting visual settings . . . please wait . . .', 0, 1)
Send("#r")
WinWaitActive("Run")
Send("sysdm.cpl{Enter}")
WinWaitActive("System Properties")
Send("{TAB 3}")
Send("{RIGHT 3}")
Send("!s")
WinWaitActive("Performance Options")
Sleep(1000)
ControlClick("Performance Options", "", "Button3")
Sleep(500)
;Use visual styles on windows and buttons
ControlSend ('Performance Options','Tree1','SysTreeView321','{End}{Space}')
Sleep(500)
;Use drop shadows for icon labels on the desktop
ControlSend ('Performance Options','Tree1','SysTreeView321','{End}{Up}{Space}')
Sleep(500)
;Use common tasks in folders
ControlSend ('Performance Options','Tree1','SysTreeView321','{End}{Up 2}{Space}')
Sleep(500)
;Show windows contents while dragging
ControlSend ('Performance Options','Tree1','SysTreeView321','{End}{Up 8}{Space}')
Sleep(500)
;Show shadows under mouse pointer
ControlSend ('Performance Options','Tree1','SysTreeView321','{End}{Up 10}{Space}')
Sleep(500)
Send("{ENTER}")
WinWaitActive("System Properties")
Send("{ENTER}")
TrayTip("clear tip","",0)
Notice that I'm not trying to click the boxes but rather--keep it simple--use ControlSend to navigate within the Combo Box and place the check mark using the spacebar. Always impressive to watch it run, too.

Where the heck is MHz when ya need 'im? :sneaky:
no peace for the wicked, no rest for the good

#5
amitri

amitri

    Junior

  • Member
  • Pip
  • 57 posts
  • Joined 24-April 04
Sorry blinkdt I'm new to Autoit, very impressive script. So if it's not too much bother - could you also change the script for the "Adjust for best performance" option.
During unattended XP somehow I always fail to do it in nLite or through regfile. Thanks in advance.

Edit: nevermind, found it, button3 only works OK

Edited by amitri, 13 August 2008 - 07:11 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users