Jump to content
Sign in to follow this  
Stuperman

System Properties Settings

Recommended Posts

Stuperman

Send("#{Pause}")

WinWaitActive("System Properties")

Send("{RIGHT 3}")

Send("!s")

WinWaitActive("Performance Options")

Send("{TAB}")

I just want to be able to uncheck certain options. I could just check "Adjust for best performance" and then re-check the options I want, but is there a way to do a specific uncheck? Or do I have to use the spacebar?

Please write back soon.

Share this post


Link to post
Share on other sites
PsaltyDS

Send("#{Pause}")

WinWaitActive("System Properties")

Send("{RIGHT 3}")

Send("!s")

WinWaitActive("Performance Options")

Send("{TAB}")

I just want to be able to uncheck certain options. I could just check "Adjust for best performance" and then re-check the options I want, but is there a way to do a specific uncheck? Or do I have to use the spacebar?

Please write back soon.

Hmm...

This should be a good time to use the GuiTreeView.au3 UDF, but I hit a snag:

; Assumes the Performance Options dialog is already open...

#include <GuiTreeView.au3>

Opt("WinTitleMatchMode", 4)

; Find window
WinWait("[CLASS:#32770; TITLE:Performance Options]")
$hWin = WinGetHandle("[CLASS:#32770; TITLE:Performance Options]")
WinActivate($hWin)
WinWaitActive($hWin)

; Find control
$hSysTV = ControlGetHandle($hWin, "", "[CLASS:SysTreeView32; INSTANCE:1]")
$iItemCount = _GUICtrlTreeView_GetCount($hSysTV)
ConsoleWrite("Debug: $hWin = " & $hWin & "  $hSysTV = " & $hSysTV & "  $iItemCount = " & $iItemCount & @LF)

; List items
$hItem = _GUICtrlTreeView_GetFirstItem($hSysTV)
For $n = 0 To $iItemCount - 1
    $sText = _GUICtrlTreeView_GetText($hSysTV, $hItem)
    $boolChecked = _GUICtrlTreeView_GetChecked($hSysTV, $hItem)
    ConsoleWrite("Debug:  Index: " & $n & "  Handle: " & $hItem & "  Text: " & $sText & "  Checked: " & $boolChecked & @LF)
    $hItem = _GUICtrlTreeView_GetNext($hSysTV, $hItem)
Next

It seems to work, but I get False back for every call to _GuiCtrlTreeView_GetChecked():

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Temp\Test\Test1.au3"   
Debug: $hWin = 0x00070274  $hSysTV = 0x0001028C  $iItemCount = 16
Debug:  Index: 0  Handle: 0x000C2DD0  Text: Animate windows when minimizing and maximizing  Checked: False
Debug:  Index: 1  Handle: 0x000C3D40  Text: Fade or slide menus into view  Checked: False
Debug:  Index: 2  Handle: 0x000DF7F0  Text: Fade or slide ToolTips into view  Checked: False
Debug:  Index: 3  Handle: 0x000C3E90  Text: Fade out menu items after clicking  Checked: False
Debug:  Index: 4  Handle: 0x000C3320  Text: Show shadows under menus  Checked: False
Debug:  Index: 5  Handle: 0x000C2FF8  Text: Show shadows under mouse pointer  Checked: False
Debug:  Index: 6  Handle: 0x000C3810  Text: Show translucent selection rectangle  Checked: False
Debug:  Index: 7  Handle: 0x000C3148  Text: Show window contents while dragging  Checked: False
Debug:  Index: 8  Handle: 0x000C2E00  Text: Slide open combo boxes  Checked: False
Debug:  Index: 9  Handle: 0x000C3FE0  Text: Slide taskbar buttons  Checked: False
Debug:  Index: 10  Handle: 0x000C34E0  Text: Smooth edges of screen fonts  Checked: False
Debug:  Index: 11  Handle: 0x000C3630  Text: Smooth-scroll list boxes  Checked: False
Debug:  Index: 12  Handle: 0x000C3B88  Text: Use a background image for each folder type  Checked: False
Debug:  Index: 13  Handle: 0x000DFC68  Text: Use common tasks in folders  Checked: False
Debug:  Index: 14  Handle: 0x000C39E0  Text: Use drop shadows for icon labels on the desktop  Checked: False
Debug:  Index: 15  Handle: 0x000DF7C0  Text: Use visual styles on windows and buttons  Checked: False
+>15:47:47 AutoIT3.exe ended.rc:0

So I can list the items and get handles to them, but checking their state and changing it doesn't work yet...

:D


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
PsaltyDS

"Oh, bother..." -- Alton Brown, 'Good Eats'

I asked GaryFrost about the checkboxes, and that GUI appears to be a custom job with non-standard checkboxes (or maybe just graphics instead of checkboxes). If they are graphics, you can use the UDF to check those, just a different way, so I'm going to experiment some more...

:D


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
PsaltyDS

Good point. But this SysTreeView32 control has ticked me off and won't escape that easily!

:D


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
Stuperman

Thank you weaponx for your input, but that link didn't really help too much. I want to disable certain boxes, not all of them. I thank everyone else for their help so far. I suppose the worst case scenario is that I set it to best performance and then go into the check box section and check the ones that I do want. If anyone can figure it out though, AWESOME. Thank you to everyone.

Share this post


Link to post
Share on other sites
PsaltyDS

Didn't get it with _GUICtrlTreeView_GetStateImageIndex(). The index is 0 every time.

Worse, I tried to get the selected states with this:

; List items
$hItem = _GUICtrlTreeView_GetFirstItem($hSysTV)
For $n = 0 To $iItemCount - 1
    $sText = _GUICtrlTreeView_GetText($hSysTV, $hItem)
    $iSelected = _GUICtrlTreeView_GetSelected($hSysTV, $hItem)
    ConsoleWrite("Debug:  Index: " & $n & "  Handle: " & $hItem & "  Text: " & $sText & "  Selected: " & $iSelected & @LF)
    $hItem = _GUICtrlTreeView_GetNext($hSysTV, $hItem)
Next

It crashed AutoIt:

AppName: rundll32.exe    AppVer: 5.1.2600.2180   ModName: comctl32.dll
ModVer: 6.0.2900.2982    Offset: 00037d6b

And generated a Dr. Watson error:

EventType : BEX  P1 : drwtsn32.exe   P2 : 5.1.2600.0     P3 : 3b7d84a2
P4 : dbghelp.dll     P5 : 5.1.2600.2180  P6 : 4110969a   P7 : 0001295d
P8 : c0000409    P9 : 00000000

:D


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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.