Sign in to follow this  
Followers 0
van_renier

How to make theme change active

10 posts in this topic

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

Share this post


Link to post
Share on other sites



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

<{POST_SNAPBACK}>

i'm pretty sure it's in the registry... double checking for the exact key right now... windows 2k/xp?

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'm pretty sure it's in the registry... double checking for the exact key right now... windows 2k/xp?

<{POST_SNAPBACK}>

Windows 2000 server

Thanks for the help.

Van

Share this post


Link to post
Share on other sites

i'm pretty sure it's in the registry... double checking for the exact key right now... windows 2k/xp?

<{POST_SNAPBACK}>

check out HKEY_CURRENT_USER\Control Panel\Desktop\ in the registry, i don't see an item in there for theme, but you can change the "Wallpaper" item to change the wallpaper... should only take a second to update that to whatever wallpaper is being used as a signal...

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

#5 ·  Posted (edited)

check out HKEY_CURRENT_USER\Control Panel\Desktop\ in the registry, i don't see an item in there for theme, but you can change the "Wallpaper" item to change the wallpaper... should only take a second to update that to whatever wallpaper is being used as a signal...

<{POST_SNAPBACK}>

The wallpaper was considered earlier on, but the change being dynamic (hopefully) wouldn't inform someone working on that system of the change if the wallpaper wasn't actually visisble ( i.e. program window was maximized). Hence, we chose the them itself, so it is very apparent of the change in status.

Also, the change to the wallpaper is the same, in that the change will not take affect until the same conditions as listed in my original posting.

Van

Edited by van_renier

Share this post


Link to post
Share on other sites

Sorry, completely off topic, but

@van_renier: cool avatar

Share this post


Link to post
Share on other sites

Sorry, completely off topic, but

@van_renier: cool avatar

<{POST_SNAPBACK}>

agreed!

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

Sorry, completely off topic, but

@van_renier: cool avatar

<{POST_SNAPBACK}>

Hahah... Thanks.

You wouldn't believe how long it actually took to finally get it off! :)

Van

Share this post


Link to post
Share on other sites

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

<{POST_SNAPBACK}>

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.

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.

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

Great... Thanks. I'll definitely take a look at this.

(Although I'm skeptical of it working as expected, I'm optimistic (hopefully) of it doing exactly what I need.)

Thanks for your time, research, and input!

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. 

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.

<{POST_SNAPBACK}>

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