Auto Theme Switcher v.1.3.2#4515
Conversation
- Fix applying lockscreen wallpaper by injecting into explorer.exe again and clearing lock screen cache
Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. For the first item, I'm not sure about the over-deletion, but the path concern makes sense.
A version that fixes both — match by file name, delete only matching slots: auto isWindhawkEntry = [](PCWSTR s) -> bool {
constexpr PCWSTR kPrefix = L"IMAGENAME:";
if (_wcsnicmp(s, kPrefix, 10) != 0) return false;
PCWSTR path = s + 10;
PCWSTR name = wcsrchr(path, L'\\');
return _wcsicmp(name ? name + 1 : path, L"windhawk.exe") == 0;
};
for (wchar_t c = L'A'; c <= L'G'; ++c) {
std::wstring suffix(1, c);
wchar_t data[512];
DWORD dataSize = sizeof(data);
if (RegGetValueW(hKey, NULL, (L"Details_" + suffix).c_str(), RRF_RT_REG_SZ, NULL, data, &dataSize) == ERROR_SUCCESS
&& isWindhawkEntry(data)) {
RegDeleteValueW(hKey, (L"Details_" + suffix).c_str());
RegDeleteValueW(hKey, (L"ImageId_" + suffix).c_str());
RegDeleteValueW(hKey, (L"OriginalFile_" + suffix).c_str());
Wh_Log(L"Cleared Lock Screen cache slot %c", c);
}
}If the slots are genuinely interdependent and Windows needs all of them cleared together for the rebuild to take effect, that's fine — but then say so in a comment, because as written it reads like an unintentional "match one, nuke all." You've tested the behavior, so you're best placed to judge; the install-path-agnostic match is the part that's clearly worth keeping regardless. This is also a persistent registry deletion that isn't undone when the mod is disabled. It's defensible as a one-time migration cleanup of the mod's own footprint (the entries it created), which is why it's not a blocker — but keeping it scoped to only the mod's entries is what keeps it within Windhawk's "no persistent system changes" principle.
|
Changelog
If this pull request updates an existing mod, describe the changes below:
Mod authorship
If this pull request introduces a new mod, please complete the section below.
This mod was created by:
Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.