Jump to content

Random Theme


pSyONiDe
 Share

Recommended Posts

Many thanks to the code samples in the help file.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1.0
; Author:        pSyONiDe <gcurtis79@mchsi.com>
;
; Script Function:
;   Theme Changer Script.
;
; ----------------------------------------------------------------------------

#include <file.au3>
#Include <process.au3>

$count = 1
$search = FileFindFirstFile("C:\Windows\Resources\Themes\*.theme")  

If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    IniWrite("themes.ini", "Themes", $count, "C:\Windows\Resources\Themes\" & $file)
    $count = $count + 1
WEnd

FileClose($search)

$lines = _FileCountLines("themes.ini")
$tn = Random(1, $lines - 1, 1)

_RunDOS("start " & IniRead("themes.ini", "Themes", $tn, "0"))

WinWait("Display Properties", "A theme is a background plus a set")
ControlClick("Display Properties", "A theme is a background plus a set", "Button3")
FileDelete("themes.ini")

Writes a themes.ini file for temorary use, then deletes it upon completion.

Will use any *.theme stored in C:\Windows\Resources\Themes\

My first usefull script yet.

Thanks for the greatest scripting thingie ever!

-Greg C.

Link to comment
Share on other sites

  • 2 weeks later...

it doesn't work every time, but it's cool!

good job!

I havn't had a problem with it yet, I have the patched uxtheme.dll file so I can use any theme I want from most sites like wincustomize and such.

I have it run on a ime after boot/login, and also in scheduler every 60 mins.

It drive my wife nuts... <-- that's my favorite part about it!

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...