Skip to content

Commit

Permalink
Classic Desktop Icons: Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
aubymori committed Sep 12, 2023
1 parent 1764b16 commit e67e4c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mods/classic-desktop-icons.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ struct
HWND hDesktop;
WNDPROC OriginalWndProc;

#define LABELBG settings.background \
? GetSysColor(COLOR_BACKGROUND) \
: CLR_NONE

void UpdateDesktop(void)
{
if (hDesktop != NULL)
Expand All @@ -86,17 +90,17 @@ void UpdateDesktop(void)
SendMessageW(hDesktop, WM_THEMECHANGED, 0, 0);

// Apply the desktop background color
DWORD dwBgColor = settings.background
? GetSysColor(COLOR_BACKGROUND)
: CLR_NONE;
DWORD dwBgColor = LABELBG;

SendMessageW(hDesktop, LVM_SETTEXTBKCOLOR, NULL, (LPARAM)dwBgColor);
}
}

#define LVM_GETACCVERSION 0x10C1

LRESULT CALLBACK NewWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_PAINT)
if (uMsg == WM_SETREDRAW || uMsg == LVM_GETITEMCOUNT)
{
UpdateDesktop();
}
Expand Down

0 comments on commit e67e4c6

Please sign in to comment.