Sign in to follow this  
Followers 0

Not working: Checking an item in a tree

2 posts in this topic

#1 ·  Posted (edited)


I want to set a custom appearance to Windows 7 by just running one file. A forum post from 2004 got me started. I almost managed to get a working AutoIt script for that, but I there is one thing which isn't working. _GUICtrlButton_SetCheck function doesn't check the button although the node is found. However, the script tells me the item is checked though it is not. What might be the reason for this?

One minor thing is that I didn't find a way to hide Performance Options window.

#include <GuiTreeView.au3>
#include <GuiButton.au3>

Opt("WinTitleMatchMode", 4)

;Opens the System Properties window and chooses the 3rd tab
;same as right click --> properties from My Computer.
Opt('WinWaitDelay', 10)
RunWait("control sysdm.cpl,,3","")

;click on the Performance Options "Settings" button
$handle = WinGetHandle("active")

;click on "Adjust for best performance"

;check desired items

$tree = ControlGetHandle("","","[CLASS:SysTreeView32; INSTANCE:1]")

$node = _GUICtrlTreeView_FindItem($tree, "Show window contents while dragging", True)
_GUICtrlTreeView_SetChecked($tree, $node, True)
If _GUICtrlTreeView_GetChecked($tree, $node) Then
    MsgBox(4160, "Information", "Congratulations!")
    MsgBox(4160, "Information", "I'm sorry")

$node = _GUICtrlTreeView_FindItem($tree, "Smooth edges of screen fonts", True)
_GUICtrlTreeView_SetChecked($tree, $node, True)

;click on "OK" button

;click on "OK" button
Edited by tsqrl

Share this post

Link to post
Share on other sites

Any ideas?

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