From 3f2268b6b2f776648046dbc85082466b94666998 Mon Sep 17 00:00:00 2001 From: spx Date: Thu, 22 Jul 2010 01:50:22 +0000 Subject: [PATCH] Minor fix for multiple %APPDATA%. --- Library/MeterWindow.cpp | 1 - Library/Rainmeter.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index b333d4a9..98820e48 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -502,7 +502,6 @@ void CMeterWindow::ChangeZPos(ZPOSITION zPos, bool all) { if(!m_ChildWindow) { - HWND parent = GetAncestor(m_Window, GA_PARENT); HWND winPos = HWND_NOTOPMOST; m_WindowZPosition = zPos; diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 9681e387..719b683c 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -3541,7 +3541,12 @@ void CRainmeter::ExpandEnvironmentVariables(std::wstring& strPath) HRESULT hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, buffer); if (SUCCEEDED(hr)) { - strPath.replace(pos, 9, buffer); + std::wstring path = buffer; + do + { + strPath.replace(pos, 9, path); + } + while ((pos = strPath.find(L"%APPDATA%", pos + path.length())) != std::wstring::npos); } }