Jump to content

Please test some code (Windows 7 Users only)


Recommended Posts

Hey, title explains most of it.. I just want to see if this theme list is the same as you get when you right click your desktop and go to "Personalize"..

#include <Array.au3>
#include <File.au3>

$array = _GetThemeList()
_ArrayDisplay($array)

Func _GetThemeList()
    Local $words[9][2] = [['AU', 'Australia'], ['CA', 'Canada'], ['GB', 'United Kingdom'], ['Hc1', 'High Contrast #1'], _
        ['hc2', 'High Contrast #2'], ['hcblack', 'High Contrast Black'], ['hcwhite', 'High Contrast White'], _
        ['US', 'United States'], ['ZA', 'South Africa']]
    Local $ret[1]

    $temp = _FileListToArray(@WindowsDir & '\Resources\Themes', '*.theme', 1)
    If $temp <> 0 Then
        ReDim $ret[$temp[0]][2]
        For $i = 1 To UBound($temp) - 1
            $ret[$i - 1][0] = $temp[$i]
            $ret[$i - 1][1] = @WindowsDir & '\Resources\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To UBound($temp) - 1
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Resources\Ease of Access Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @WindowsDir & '\Resources\Ease of Access Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Globalization\MCT', '*', 2)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            $temp2 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i], '*', 2)
            If $temp2 <> 0 Then
                For $i2 = 1 To $temp2[0]
                    $temp3 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2], '*.theme', 1)
                    If $temp3 <> 0 Then
                        For $i3 = 1 To $temp3[0]
                            ReDim $ret[UBound($ret)+1][2]
                            $ret[UBound($ret)-1][0] = $temp3[$i3]
                            $ret[UBound($ret)-1][1] = @WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2] & '\' & $temp3[$i3]
                        Next
                    EndIf
                Next
            EndIf
        Next
    EndIf

    _ArraySort($ret)


    For $i = 0 To UBound($ret) - 1
        $temp = StringTrimRight($ret[$i][0], 6) ; get rid of .theme
        $l = StringLeft($temp, 1)
        $temp = StringUpper($l) & StringRight($temp, StringLen($temp) - 1)
        $ret[$i][0] = $temp
    Next

    For $i = 0 to UBound($ret) - 1
        $temp = _ArraySearch($words, $ret[$i][0])
;~      ConsoleWrite('>Searching: ' & $ret[$i][0] & @TAB & 'Result: ' & $temp & @CRLF)
        If $temp > -1 then $ret[$i][0] = $words[$temp][1]
    Next

    Return $ret
EndFunc   ;==>_GetThemeList

Edit: Added some specific country themes

Edit2: Added some more stuff

Edited by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Script returned:

Aero
Architecture
Characters
Custom
Landscapes
Nature
Scenes

This is listing the Aero themes, but is missing one that was listed in personalize. In personalize, I also have a theme called "United States".

Here is my personalize menu:

Posted Image

Edited by danwilli
Link to comment
Share on other sites

Script returned:

Aero
Architecture
Characters
Custom
Landscapes
Nature
Scenes

This is listing the Aero themes, but is missing one that was listed in personalize. In personalize, I also have a theme called "United States".

Here is my personalize menu:

<pic>

I just saw that it has some based off of what country your in (I think...).. mind testing it again?

I think I'm going to running into problems with themes being named the same when it comes to actually using this list :mellow:

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Yes that gets them all.

I also whipped this up to grab them:

#include <Array.au3>
#include <File.au3>

$array = _GetThemeList()
_ArrayDisplay($array)

Func _GetThemeList()
    Local $ret[1]

    $temp = _FileListToArray(@WindowsDir & '\Resources\Themes', '*.theme', 1)
    If $temp <> 0 Then
        ReDim $ret[$temp[0]][2]
        For $i = 1 To UBound($temp) - 1
            $ret[$i - 1][0] = $temp[$i]
            $ret[$i - 1][1] = @WindowsDir & '\Resources\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To UBound($temp) - 1
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Resources\Ease of Access Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @WindowsDir & '\Resources\Ease of Access Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Globalization\MCT', '*', 2)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            $temp2 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i], '*', 2)
            If $temp2 <> 0 Then
                For $i2 = 1 To $temp2[0]
                    $temp3 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2], '*.theme', 1)
                    If $temp3 <> 0 Then
                        For $i3 = 1 To $temp3[0]
                            ReDim $ret[UBound($ret)+1][2]
                            $ret[UBound($ret)-1][0] = $temp3[$i3]
                            $ret[UBound($ret)-1][1] = @WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2] & '\' & $temp3[$i3]
                        Next
                    EndIf
                Next
            EndIf
        Next
    EndIf

    _ArraySort($ret)

    For $i = 0 To UBound($ret) - 1
        $temp = StringTrimRight($ret[$i][0], 6) ; get rid of .theme
        $l = StringLeft($temp, 1)
        $temp = StringUpper($l) & StringRight($temp, StringLen($temp) - 1)
        $ret[$i][0] = $temp
    Next

    Return $ret
EndFunc   ;==>_GetThemeList

This way if for any reason there are additional themes in the global section, we grab them.

EDIT: Redim was in wrong section... fixed that and added the basic themes.

Edited by danwilli
Link to comment
Share on other sites

Yes that gets them all.

I also whipped this up to grab them:

#include <Array.au3>
#include <File.au3>

$array = _GetThemeList()
_ArrayDisplay($array)

Func _GetThemeList()
    Local $ret[1]

    $temp = _FileListToArray(@WindowsDir & '\Resources\Themes', '*.theme', 1)
    If $temp <> 0 Then
        ReDim $ret[$temp[0]][2]
        For $i = 1 To UBound($temp) - 1
            $ret[$i - 1][0] = $temp[$i]
            $ret[$i - 1][1] = @WindowsDir & '\Resources\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To UBound($temp) - 1
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @UserProfileDir & '\AppData\Local\Microsoft\Windows\Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Resources\Ease of Access Themes', '*.theme', 1)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            ReDim $ret[UBound($ret)+1][2]
            $ret[UBound($ret)-1][0] = $temp[$i]
            $ret[UBound($ret)-1][1] = @WindowsDir & '\Resources\Ease of Access Themes\' & $temp[$i]
        Next
    EndIf

    $temp = _FileListToArray(@WindowsDir & '\Globalization\MCT', '*', 2)
    If $temp <> 0 Then
        For $i = 1 To $temp[0]
            $temp2 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i], '*', 2)
            If $temp2 <> 0 Then
                For $i2 = 1 To $temp2[0]
                    $temp3 = _FileListToArray(@WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2], '*.theme', 1)
                    If $temp3 <> 0 Then
                        For $i3 = 1 To $temp3[0]
                            ReDim $ret[UBound($ret)+1][2]
                            $ret[UBound($ret)-1][0] = $temp3[$i3]
                            $ret[UBound($ret)-1][1] = @WindowsDir & '\Globalization\MCT\' & $temp[$i] & '\' & $temp2[$i2] & '\' & $temp3[$i3]
                        Next
                    EndIf
                Next
            EndIf
        Next
    EndIf

    _ArraySort($ret)

    For $i = 0 To UBound($ret) - 1
        $temp = StringTrimRight($ret[$i][0], 6) ; get rid of .theme
        $l = StringLeft($temp, 1)
        $temp = StringUpper($l) & StringRight($temp, StringLen($temp) - 1)
        $ret[$i][0] = $temp
    Next

    Return $ret
EndFunc   ;==>_GetThemeList

This way if for any reason there are additional themes in the global section, we grab them.

EDIT: Redim was in wrong section... fixed that and added the basic themes.

Wow, awesome thanks for that! the only think I'll probably add is a simply little function that goes through and replaces things like hc1 with High Contrast #1, or AU with Australia
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Not sure if you still need feedback, but I'm a little unsure about my results:

I have 1 custom theme, 6 aero and 6 basic for a total of 13 themes, however it only lists 12.

I can account for all aero themes, but I have 6 basic themes that I can't link to the 5 remaining themes on the list.

listed themes - personalize menu themes

Aero - "Windows 7"

Architecture- "Architectuur"

Characters - "Figuren"

Landscapes - "Landschaoppen"

Nature - "Openlucht"

Scenes - "Scènes"

MyCustom - "My custom theme"

Australia - ?

Canada -?

South Africa - ?

United Kingdom - ?

United States -

? - "Windows 7 Basic"

? - "Windows-klassiek"

? - "Hoog Contrast nr.1"

? - "Hoog Contrast nr.2"

? - "Zwart - hoog contrast"

? - "Wit - hoog contrast"

Red themes are on the list, but I don't know what theme they corrospond to.

Blue themes are in the personalize menu, but I don't know what list item they corrospond to.

Win7 Ultimate x64 (English with dutch language pack)

Link to comment
Share on other sites

Ok, I updated the original code with the changes danwilli made (thanks!).. I made it so the names turn out nicer..

Here are the results I get:

[0]|Aero|C:\Windows\Resources\Themes\aero.theme

[1]|Architecture|C:\Windows\Resources\Themes\architecture.theme

[2]|Australia|C:\Windows\Globalization\MCT\MCT-AU\Theme\AU.theme

[3]|Basic|C:\Windows\Resources\Ease of Access Themes\basic.theme

[4]|Canada|C:\Windows\Globalization\MCT\MCT-CA\Theme\CA.theme

[5]|Characters|C:\Windows\Resources\Themes\characters.theme

[6]|Classic|C:\Windows\Resources\Ease of Access Themes\classic.theme

[7]|United Kingdom|C:\Windows\Globalization\MCT\MCT-GB\Theme\GB.theme

[8]|High Contrast #1|C:\Windows\Resources\Ease of Access Themes\hc1.theme

[9]|High Contrast #2|C:\Windows\Resources\Ease of Access Themes\hc2.theme

[10]|High Contrast Black|C:\Windows\Resources\Ease of Access Themes\hcblack.theme

[11]|High Contrast White|C:\Windows\Resources\Ease of Access Themes\hcwhite.theme

[12]|Landscapes|C:\Windows\Resources\Themes\landscapes.theme

[13]|Nature|C:\Windows\Resources\Themes\nature.theme

[14]|Old Backgrounds|C:\Users\Michael\AppData\Local\Microsoft\Windows\Themes\Old Backgrounds.theme

[15]|Scenes|C:\Windows\Resources\Themes\scenes.theme

[16]|Select Windows|C:\Users\Michael\AppData\Local\Microsoft\Windows\Themes\Select Windows.theme

[17]|United States|C:\Windows\Globalization\MCT\MCT-US\Theme\US.theme

[18]|South Africa|C:\Windows\Globalization\MCT\MCT-ZA\Theme\ZA.theme

Edit: Ugh, looks like I'm going to have to do some language changes... Edited by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

The one in the original post. :mellow:

For some reason I assumed that one would be up to date, "Example script" style.

All is well. I'll be the one in the corner with the donkey ears.

lol, that was my bad.. it would make sense to keep the code that needed to be testing in the original post..
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...