Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change anything, theme is not applied. #91

Closed
4 tasks done
VerMishelb opened this issue Aug 4, 2022 · 7 comments
Closed
4 tasks done

Can't change anything, theme is not applied. #91

VerMishelb opened this issue Aug 4, 2022 · 7 comments
Labels

Comments

@VerMishelb
Copy link

Windows Version: Win 10 21H2 19044.1826

Question
Applying theme brings up "Please wait..." screen but in the end the default aero.msstyle is being used. Testing theme doesn't work at all. I'm pretty sure I'm doing something wrong but I have no idea what exactly.

Things you already tried
Copied default aero.msstyle to other place, exported Button/PUSHBUTTON, made some changes in photoshop, resaved, imported back replacing the original one (it's displayed in editor just fine). Saved the theme as "aeromish.msstyle" for the sake of testing stuff. Pressing Test button brings up 0x80070490 HRESULT exception (Element not found). Putting the theme to Themes folder and making a copy of aero.theme with replaced VisualStyles path with further application via SecureUxTheme ThemeTool brings up "please wait..." then uses aero.msstyle anyway. ThemeTool log doesn't say anything about going wrong.

Checklist

  • My uxtheme.dll is patched (well, ThemeTool installation was made, without applying hooks to explorer, SystemSettings and LogonUI though, so I'm not sure if it counts as "patched").
  • I am using the latest version of msstyleEditor.
  • I checked the Wiki.
  • None of the other issues cover this (couldn't personally find).
@nptr
Copy link
Owner

nptr commented Aug 4, 2022

It looks like theme activation fails altogether (Windows and msstyleEditor). I'd suspect that the theme is corrupted or its dependencies are missing - this was a long standing issue that I only fixed recently (and thought to have fully fixed). Some background info, depending on how much you care: #67 (comment)

To know more, I'd need to have your original Aero style (the complete folder) as well as the modified one (either .msstyles or the whole modified folder). I can then test locally and inspect the exported style for any faults.

For now I can only guess. I'd hope that it's just some language resource (MUI) thing that I didn't get right and now Windows complains because it can't find the image for the pushbutton. That would be the easiest to fix.

@VerMishelb
Copy link
Author

I've uploaded entire Themes folder (https://drive.google.com/file/d/128TThckCdaiVA0AGBCNcKdVrrpEvJtjW/view?usp=sharing). This includes modified aeromish.msstyle (and aerolite.theme left from when I discovered the high contrast theme). The rest should be as it was in original, I didn't modify anything else.

@nptr
Copy link
Owner

nptr commented Aug 5, 2022

I think i see the problem. It has to do with multilingual resources and the that they are located by naming convention.

Opening "[folder]/aero.msstyles" makes Windows API search for "[folder]/[language]/aero.msstyles.mui".
msstyleEditor then has all data available. It will merge the language resources into the .msstyles file when saving so the language folders are no longer needed.

If you rename the original file before opening it for the first time, then Windows and msstyleEditor won't find the language dependent resources and can't make it relocatable. "[folder]/[language}/[renamedstyle].msstyles.mui" is then still necessary.

Workaround: Open aero.msstyles when it is still next to the language folders and save it somewhere else. It should now be relocatable and you won't have to worry about it again. You'll have to redo your changes then.

I'll change msstyleEditor to emit a warning if something like that happens. I'll also change the documentation to not be misleading with the whole renaming thing.

Let me know if that indeed fixed the issue.

@VerMishelb
Copy link
Author

I've opened aero.msstyles and finally noticed that there are in fact two save buttons, with and without MUI.

Saving without MUI doesn't cause problems. However, now the test button throws HRESULT E_FAIL after execution of some COM component (which of course is not specified because WinAPI, I guess).

Saving with MUI throws "Updating string resource with id '7' failed with error '50'".

And while I was writing, for some reason opening aero.msstyle and editing it doesn't cause any errors now and the theme is applied when I press test...?

Oh for GOD'S sake I understood. PNG 8. It doesn't support it. If I use a regular PNG it works. If I use PNG 8 I get HRESULT E_FAIL. Fun stuff. Also there is one misplaced pixel in pushbutton hover state I can't unsee.

I'll do something with theme and if it won't work I'll write another reply here.

@VerMishelb
Copy link
Author

I've finished whatever I was trying to do and the results are somehow strange. When I press "test" it works all fine, except for window corner and stuff I haven't figured out yet. However, when I use ThemeTool to apply it, buttons glyphs corrupt and the title bar receives a colour.
Test:
Test
ThemeTool applying the same theme:
ThemeTool

@nptr
Copy link
Owner

nptr commented Aug 6, 2022

The 8-bit PNG issue I can work around in code. Or at least warn about.

With the window frame and button gylphs I don't know yet. ThemeTool applies the themes from the Windows theme folder. Namaszo uses COM for that.

I am saving the style temporary in User/Public/Documents and then use Win32 API (wrapping COM) to apply it. It's not as "direct" but has some other advantages.

That's were the differences might come from. More dependency issues maybe even.

@VerMishelb
Copy link
Author

Glyph corruption solved. I had to remove the cached version of my theme in C:\Windows\Resources\Themes\aero\VSCache manually to make it work correctly. To do that I also had to take ownership of this folder because for whatever reason it's not only protected, but the cache files are considered system files so I had to enable them in explorer options too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants