How to choose a theme programmatically in Vista

A software package I'm working on installs its own Windows theme and as part of the installation tries to make it the current theme. We were able to get this to work on Windows XP with a lot of registry changes during setup (reboot applies the changes), but Vista seems to require even more requisition changes.

We also found that "launching" the theme file would open the Themes dialog and select a theme, but the user needs to click OK. A script can accomplish this, it is true, but finding the OK button in a non-english language is a problem I wouldn't have to deal with.

So, is there a way to programmatically change the current theme in Windows Vista?

+1


source to share


2 answers


Sorry to have an old thread, but I can still see this question on the internet.

Windows is still not very far from its DOS roots. You can copy this command to open the control panel and upload your theme.

This works for Windows 7, but can be changed for Vista. Just copy this or type it into the command window:



C: \ Windows \ system32 \ rundll32.exe C: \ Windows \ system32 \ shell32.dll, Control_RunDLL C: \ Windows \ system32 \ desk.cpl desk, @ Themes / Action: OpenTheme / file: SomeDir \ filename. ThemePack

Basically, just use rundll32 to launch your control panel and then feed it to your theme. A control panel dialog will appear, but the theme will be installed automatically.

If you want to install a theme without a popup, you'll need to do a massive registry hack.

+2


source


Here's a dirty hack: If all else fails, you can try the UI Automation Toolkit automatically "click" on the OK button. :)



0


source







All Articles