Sign in to follow this  
Followers 0
Digetal

Are there any change xp theme scripts?

13 posts in this topic

#1 ·  Posted (edited)

;)

I was just wondering if anyone happend to have a script to change a xp theme?

FlyingBoz made a great script to change wallpaper found here: http://www.autoitscript.com/forum/index.php?showtopic=16628

The reg edits involved are the easiest part of this. A dllcall that can refresh the windowsxp theme is what I'm really looking for!! If this has already been posted please reply with a link. Thnx.

:P

Edited by Digetal

Share this post


Link to post
Share on other sites



I am looking for the same functionality as well. Maybe someone like larry can help us out.


Who else would I be?

Share this post


Link to post
Share on other sites

thanks Valuater! I'll check those out and reply...

Share this post


Link to post
Share on other sites

All I could find out is that it might have something to do with this: RUNDLL32 uxtheme.dll, SetWindowTheme

but I'm not sure of how to use it properly ;)

Share this post


Link to post
Share on other sites

All I could find out is that it might have something to do with this: RUNDLL32 uxtheme.dll, SetWindowTheme

but I'm not sure of how to use it properly ;)

a few months back i remember someone wanted to change the theme of a window based on a condition. If i'm not mistaken, a solution was posted for that here in the support forum...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

According to MSDN, the SetWindowTheme function only manipulates one window at a time, so it's probably not what you're after.

You might find something of use somewhere here...?

Share this post


Link to post
Share on other sites

I found something in an autoit forum that might lead to the answer when used properly.

http://www.autoitscript.com/forum/index.ph...948entry93948

or just read it below ----v

*-------------------------------------------------------------------------------------------------------------------------*

QUOTE(van_renier @ Jul 19 2005, 10:51 AM)

I know how to change the active theme, but, normally, the change won't take affect until either the system is rebooted, the user logs off/on, or explorer.exe (the 'base') is ended/restarted.

We are using Au3 to detect which server is consdiered the primary/active server, and change the desktop themes (color schemes) dynamically, so the admins know from glancing at a server's desktop if that system is or is not active.

(i know there are numerous other ways to 'notify' the admins, but this is the way agreed on/approved of.

I know there has to be a way to make the change take affect WITHOUT bringing up the display properties and clicking APPLY/OK; like a dll call or something.

Does anyone know how to do this?

Thanks,

(Van)

i found something for you that may help. it is possible to change the theme using a function in the uxtheme.dll file. i'm on 2000 here at work so i can't write/test here, but this should be enough to help you i hope.

QUOTE(From the MS Platform SDK documentation)

SetWindowTheme Function

--------------------------------------------------------------------------------

Causes a window to use a different set of visual style information than its class normally uses.

Syntax

HRESULT SetWindowTheme( HWND hwnd,

LPCWSTR pszSubAppName,

LPCWSTR pszSubIdList

);

Parameters

hwnd

[in] Handle to the window whose visual style information is to be changed.

pszSubAppName

[in] Pointer to a string that contains the application name to use in place of the calling application's name. If this parameter is NULL, the calling application's name is used.

pszSubIdList

[in] Pointer to a string that contains a semicolon-separated list of class identifier (CLSID) names to use in place of the actual list passed by the window's class. If this parameter is NULL, the identifier (ID) list from the calling class is used.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The theme manager retains the pszSubAppName and the pszSubIdList associations through the lifetime of the window, even if visual styles subsequently change. The window is sent a WM_THEMECHANGED message at the end of a SetWindowTheme call, so that the new visual style can be found and applied.

When pszSubAppName and pszSubIdList are NULL, the theme manager removes the previously applied associations. To prevent visual styles from being applied to a specified window, pass an empty string, (L" "), which will not match any section entries.

Function Information

Stock Implementation UxTheme.dll

Custom Implementation No

Header uxtheme.h

Import library UxTheme.lib

Minimum operating systems Windows XP

ok, so you can use the SetWindowTheme() from uxtheme.dll with the dll functions in autoit. and according to the remarks, after you use that function, it sends a message to your window to let it know that the theme is changed and to update it. if you can implement this, should do exactly what you want it to.

*-------------------------------------------------------------------------------------------------------------------------*

Thanx LxP, I'll keep at looking until I get somehing....

Eventually, just start trying code.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

;)

ok, this is the script I made a while back. It automatically changes the xp theme to the next one on the list.

But, I really needd a way to do this without the display page even appearing.......... ?possible?

there has got to be a simple way around this! (OUT OF THE BOX METHOD) needed here

Opt("WinTitleMatchMode", 4)

Run(@ComSpec & " /C " & "desk.cpl", "", "")

WinWait("Display Properties","")

WinSetState("Display Properties","",@SW_HIDE)

Send("{RIGHT}")

Send("{enter}")

Edited by Digetal

Share this post


Link to post
Share on other sites

ohh I also found that the command bellow opens any specific theme. I'll test for a action such as SetTheme

C:\WINDOWS\system32\rundll32.exe C:\WINDOWS\system32\shell32.dll,Control_RunDLL C:\WINDOWS\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\WINDOWS\Resources\Themes\Luna.Theme"

;)

Share this post


Link to post
Share on other sites

Ok, I got to give this a rest. This is the best I could do so far

;#### new.cmd ---v

rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\WINDOWS\Resources\Themes\Dazzle.Theme"

exit

####

run("new.cmd", "", @SW_HIDE)

Opt("WinTitleMatchMode", 4)

WinWait("Display Properties" )

WinSetState("Display Properties", "", @SW_HIDE)

WinActivate("Display Properties")

Send("{enter}")

Exit

this works very quickly to change to a specified theme, but the "dispay properties" window does appear.

if I could get autoit to recognize the dos comand with the equired "theme path" then i wouldn't need the batch file. If any one gets any other ideas please repond!

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Ok, I got to give this a rest. This is the best I could do so far

;#### new.cmd ---v

rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\WINDOWS\Resources\Themes\Dazzle.Theme"

exit

####

run("new.cmd", "", @SW_HIDE)

Opt("WinTitleMatchMode", 4)

WinWait("Display Properties" )

WinSetState("Display Properties", "", @SW_HIDE)

WinActivate("Display Properties")

Send("{enter}")

Exit

this works very quickly to change to a specified theme, but the "dispay properties" window does appear.

if I could get autoit to recognize the dos comand with the equired "theme path" then i wouldn't need the batch file. If any one gets any other ideas please repond!

ok, one thing you could use is:

WinSetState("Display Properties","",@SW_HIDE)
to hide the window as soon as it pops up and still use ControlClick() and ControlSend() to perform your manipulation within the window...

***edit*** sorry it's early, didn't even see that you had the setstate already in there...would have helped to read the code first eh?

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I have learned that only applications with "trusted address space" can change global themes. Therefore, most system services have this "power", but not most normal applications.


Who else would I be?

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