Skip to content

Update nf-uxtheme-setwindowtheme.md#1936

Merged
jwmsft merged 1 commit intoMicrosoftDocs:docsfrom
RatinCN:patch-9
Feb 5, 2025
Merged

Update nf-uxtheme-setwindowtheme.md#1936
jwmsft merged 1 commit intoMicrosoftDocs:docsfrom
RatinCN:patch-9

Conversation

@RatinCN
Copy link
Contributor

@RatinCN RatinCN commented Nov 18, 2024

An empty string should not contain such a space



When <i>pszSubAppName</i> and <i>pszSubIdList</i> are <b>NULL</b>, the theme manager removes the previously applied associations. You can prevent visual styles from being applied to a specified window by specifying an empty string, (L" "), which does not match any section entries.
When <i>pszSubAppName</i> and <i>pszSubIdList</i> are <b>NULL</b>, the theme manager removes the previously applied associations. You can prevent visual styles from being applied to a specified window by specifying an empty string, (L""), which does not match any section entries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this space is deliberate and we should correct the text instead. After a quick glance, it does appear uxtheme!SetWindowTheme behaves differently if "", " ", or nullptr is passed in.

Suggested change
When <i>pszSubAppName</i> and <i>pszSubIdList</i> are <b>NULL</b>, the theme manager removes the previously applied associations. You can prevent visual styles from being applied to a specified window by specifying an empty string, (L""), which does not match any section entries.
When <i>pszSubAppName</i> and <i>pszSubIdList</i> are <b>NULL</b>, the theme manager removes the previously applied associations. You can prevent visual styles from being applied to a specified window by specifying a string with a space, (L" "), which does not match any section entries.

Copy link
Contributor Author

@RatinCN RatinCN Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If pass L"", SetWindowTheme will assign L"$" to the property, which does not match anything.
And L" " does not match anything too, because no theme atom named " ".
SetWindowTheme compares income string with L"" explicitly, and uses L"$" replace it. So I think this should be the preset input for this function, rather than L" ".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation has the $ logic, but I wonder if that's supported downlevel with older releases. If so, then I agree!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, Windows keeps this behavior since NT5. Imoh, the key is it compares L"", so this should be the preset input, whatever it replaces empty string by L"$" or L" " or others. Thanks for your attention : )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, feel free to mark as resolved.

@jwmsft jwmsft self-assigned this Feb 5, 2025
@jwmsft jwmsft merged commit 630ca78 into MicrosoftDocs:docs Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants