Jump to content

When a control doesn't respond to ControlClick()... - (Moved)


Recommended Posts

Help! The mouse clicks I'm sending to a control on a dialog box produce no response.

The dialog box in question handles advanced display properties. The tab page my script interacts with is created by Trident Microsystems. It allows the user to enhance or attenuate the screen's RGB values. (See image.) My script automates the process of changing these in order to adjust the screen's hue or, when the red, green and blue values are all the same, the brightness.

Producing a script to change the brightness has been quite straightforward. I use ControlClick() to send a mouse click to one of the trackbars on the right of the tab page. By default, they're linked and so move as one. The difficulty I'm having however is in automating the process when the desired red, green and blue values aren't the same as each other.

Ordinarily, there are three ways of doing this: 

(1) clear the Link check box to unlink the three trackbars then either click on each trackbar or drag their sliders,

(2) clear the Link tick-box then for each colour, click on the corresponding trackbar slider (to select it) then click on a point on the graph, and

(3) click on the Load button to open an Open dialog box and load a preset (stored as a .gam file).

However, when ControlClick() is used to clear the Link check box or to push the Load button, nothing happens. Making the dialog box the active window makes no difference.

The AutoIt Window Info tool indicates that the Reload a BitmapSave, Load and Reset buttons, the Link check box and the graph are all the same control. (See other images.) In fact, it there are only four controls on the page: the tab page, which is an instance of a SysTabControl32 class, and the three trackbars, each of which is an instance of the TridentTrackBar class. (Am unsure whether the SysTabControl32 class is a Windows or third-party control.)

What's the solution?

Note that the MouseClick() function—as opposed to ControlClick()—does work, but having AutoIt commandeer the screen pointer isn't an acceptable solution.

For the sake of completeness, here's the relevant code fragment for the Link check box. 

;unlink trackbars
WinActivate("(Multiple Monitors)")
ControlClick("(Multiple Monitors)", "", 12320, "left", 1, 211, 252)

 

Dialog box.jpg

AIWI – Link check box.jpg

AIWI – Load button.jpg

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks for reminding me, Luke94. Yes. Tried it.

Have also tried using _WinAPI_SetWindowPos() with $HWND_TOP for the $hAfter parameter to bring the dialog box to the top of the z-order. 

The calls to WinActivate(), ControlFocus() and _WinAPI_SetWindowPos(), as well as to ControlClick(), all return True (i.e. success), but don't produce the desired effect. 

 

Link to comment
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
 Share

×
×
  • Create New...