diff options
author | John Ankarström <john@ankarstrom.se> | 2022-04-01 02:36:26 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-04-01 02:36:26 +0200 |
commit | 4f98051cbe62171775f6b319400b6dc6c2841e07 (patch) | |
tree | c98767ccb6d627ac23d92007d9d8c85b78818c5e /c/main.c | |
parent | 501a76b93264ea2ca34a8f1d01c6e9ae0c43ca33 (diff) | |
download | EpisodeBrowser-4f98051cbe62171775f6b319400b6dc6c2841e07.tar.gz |
Clarify control flow in UpdateTheme.
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -302,15 +302,19 @@ UpdateTheme() { int bThemeActive; extern HWND HElv, HDlv; - static int bTheming = -1; + static int bThemes = -1; - if (bTheming == -1) { + switch (bThemes) { + case -1: + { HMODULE hModule; hModule = LoadLibrary(TEXT("uxtheme.dll")); - bTheming = hModule && GetProcAddress(hModule,"SetWindowTheme"); + bThemes = hModule && GetProcAddress(hModule,"SetWindowTheme"); + break; + } + case 1: + bThemeActive = IsThemeActive(); + LvSetTheme(HElv, bThemeActive); + LvSetTheme(HDlv, bThemeActive); } - if (!bTheming) return; - bThemeActive = IsThemeActive(); - LvSetTheme(HElv, bThemeActive); - LvSetTheme(HDlv, bThemeActive); } |