From f28552b3d3bcb691b14395512bd6ab27b652ae8d Mon Sep 17 00:00:00 2001 From: Kevin Koltzau Date: Tue, 17 Feb 2004 20:22:27 +0000 Subject: [PATCH] Keep track of theme filename within THEME_FILE. --- dlls/uxtheme/msstyles.c | 3 +++ dlls/uxtheme/msstyles.h | 1 + dlls/uxtheme/system.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 95ad22228a6..fe106c8af0a 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -174,6 +174,9 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST *tf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(THEME_FILE)); (*tf)->hTheme = hTheme; + + GetFullPathNameW(lpThemeFile, MAX_PATH, (*tf)->szThemeFile, NULL); + (*tf)->pszAvailColors = pszColors; (*tf)->pszAvailSizes = pszSizes; (*tf)->pszSelectedColor = pszSelectedColor; diff --git a/dlls/uxtheme/msstyles.h b/dlls/uxtheme/msstyles.h index f6ef3480067..53ef348289a 100644 --- a/dlls/uxtheme/msstyles.h +++ b/dlls/uxtheme/msstyles.h @@ -59,6 +59,7 @@ typedef struct _THEME_CLASS { typedef struct _THEME_FILE { DWORD dwRefCount; HMODULE hTheme; + WCHAR szThemeFile[MAX_PATH]; LPWSTR pszAvailColors; LPWSTR pszAvailSizes; diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index 6bd3b780228..531c1f81f67 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -152,7 +152,7 @@ HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) return hr; if(tf) { bThemeActive = TRUE; - GetModuleFileNameW(tf->hTheme, szCurrentTheme, sizeof(szCurrentTheme)/sizeof(szCurrentTheme[0])); + lstrcpynW(szCurrentTheme, tf->szThemeFile, sizeof(szCurrentTheme)/sizeof(szCurrentTheme[0])); lstrcpynW(szCurrentColor, tf->pszSelectedColor, sizeof(szCurrentColor)/sizeof(szCurrentColor[0])); lstrcpynW(szCurrentSize, tf->pszSelectedSize, sizeof(szCurrentSize)/sizeof(szCurrentSize[0])); }