diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index b62674bd..f70e84a6 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -1236,7 +1236,7 @@ void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring& { // LogWithArgs(LOG_DEBUG, L"[%s] %s=%s (size: %i)", strSection.c_str(), strKey.c_str(), strValue.c_str(), (int)m_Values.size()); - std::wstring strTmp = strSection + L"::"; + std::wstring strTmp = strSection + L"~"; strTmp += strKey; m_Values[StrToLowerC(strTmp)] = strValue; @@ -1252,7 +1252,7 @@ void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring& */ void CConfigParser::DeleteValue(const std::wstring& strSection, const std::wstring& strKey) { - std::wstring strTmp = strSection + L"::"; + std::wstring strTmp = strSection + L"~"; strTmp += strKey; std::unordered_map::iterator iter = m_Values.find(StrToLowerC(strTmp)); @@ -1273,7 +1273,7 @@ void CConfigParser::DeleteValue(const std::wstring& strSection, const std::wstri */ const std::wstring& CConfigParser::GetValue(const std::wstring& strSection, const std::wstring& strKey, const std::wstring& strDefault) { - std::wstring strTmp = strSection + L"::"; + std::wstring strTmp = strSection + L"~"; strTmp += strKey; std::unordered_map::const_iterator iter = m_Values.find(StrToLowerC(strTmp)); diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index 0384090b..111c69e3 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -405,9 +405,6 @@ void CDialogManage::CTabSkins::Initialize() SetWindowLong(item, GWL_EXSTYLE, GetWindowLong(item, GWL_EXSTYLE) &~ WS_EX_CLIENTEDGE); SetWindowPos(item, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK); - ShowWindow(item, SW_HIDE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON); tmpSz = GetString(ID_STR_DISPLAYMONITOR); if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 7b7325a2..cb6d21fd 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -833,9 +833,9 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons // Error std::wstring error = L"Measure="; error += measure; - error += L" is not valid in section ["; + error += L" is not valid in ["; error += name; - error += L"]."; + error += L"]"; throw CError(error, __LINE__, __FILE__); return NULL; diff --git a/Library/MeasureRegistry.cpp b/Library/MeasureRegistry.cpp index 34002b98..52b3ead2 100644 --- a/Library/MeasureRegistry.cpp +++ b/Library/MeasureRegistry.cpp @@ -151,9 +151,9 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"HKEY=" + keyname; - error += L" is not valid in measure ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; + error += L"]"; throw CError(error, __LINE__, __FILE__); } diff --git a/Library/Meter.cpp b/Library/Meter.cpp index 703899a9..1a2d94f4 100644 --- a/Library/Meter.cpp +++ b/Library/Meter.cpp @@ -740,14 +740,14 @@ void CMeter::UpdateToolTip() TOOLINFO ti = {sizeof(TOOLINFO)}; ti.hwnd = m_MeterWindow->GetWindow(); - SendMessage(hwndTT, TTM_GETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti); + SendMessage(hwndTT, TTM_GETTOOLINFO, NULL, (LPARAM)&ti); std::wstring text = m_ToolTipText; ReplaceToolTipMeasures(text); - ti.lpszText = (PTSTR) text.c_str(); + ti.lpszText = (LPTSTR)text.c_str(); ti.rect = GetMeterRect(); - SendMessage(hwndTT, TTM_SETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti); + SendMessage(hwndTT, TTM_SETTOOLINFO, NULL, (LPARAM)&ti); SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, m_ToolTipWidth); if (!m_ToolTipTitle.empty()) @@ -759,15 +759,15 @@ void CMeter::UpdateToolTip() { if (_wcsicmp(m_ToolTipIcon.c_str(), L"INFO") == 0) { - hIcon = (HICON) TTI_INFO; + hIcon = (HICON)TTI_INFO; } else if (_wcsicmp(m_ToolTipIcon.c_str(), L"WARNING") == 0) { - hIcon = (HICON) TTI_WARNING; + hIcon = (HICON)TTI_WARNING; } else if (_wcsicmp(m_ToolTipIcon.c_str(), L"ERROR") == 0) { - hIcon = (HICON) TTI_ERROR; + hIcon = (HICON)TTI_ERROR; } else if (_wcsicmp(m_ToolTipIcon.c_str(), L"QUESTION") == 0) { @@ -779,14 +779,14 @@ void CMeter::UpdateToolTip() } else { - hIcon = (HICON) LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE); + hIcon = (HICON)LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE); destroy = true; } } text = m_ToolTipTitle; ReplaceToolTipMeasures(text); - SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM) text.c_str()); + SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM)text.c_str()); if (destroy) { diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index d1e5921c..7067956e 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -3528,22 +3528,14 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) std::wstring command = m_SkinPath + m_SkinName; command += L"\\"; command += m_SkinIniFile; - HANDLE file = CreateFile(command.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + bool writable = CSystem::IsFileWritable(command.c_str()); command.insert(0, L" \""); command.insert(0, m_Rainmeter->GetConfigEditor()); command += L"\""; - if (file == INVALID_HANDLE_VALUE) - { - // File is in protected location, so execute as admin - RunCommand(NULL, command.c_str(), SW_SHOWNORMAL, true); - } - else - { - CloseHandle(file); - RunCommand(NULL, command.c_str(), SW_SHOWNORMAL); - } + // Execute as admin if in protected location + RunCommand(NULL, command.c_str(), SW_SHOWNORMAL, !writable); } else if (wParam == ID_CONTEXT_SKINMENU_REFRESH) { diff --git a/Library/lua/LuaScript.cpp b/Library/lua/LuaScript.cpp index 3e929f27..525a1c43 100644 --- a/Library/lua/LuaScript.cpp +++ b/Library/lua/LuaScript.cpp @@ -215,31 +215,3 @@ void LuaScript::RunString(const char* str) } } } - -//void LuaScript::BindVariable(const char* p_strName, void* p_pValue, const char* p_strTypeName) -//{ -// PushTable(); -// -// /* -// // Push the variable name we want to put a value in. -// lua_pushstring(m_State, p_strName); -// // Push the value -// tolua_pushusertype(m_State, p_pValue, p_strTypeName); -// // Bind the variable -// lua_settable(m_State, -3); -// -// // Pop our table off of the stack -// lua_pop(m_State, 1); -// -// */ -// -// // Push the variable name we want to put a value in. -// lua_pushstring(m_State, "SKIN"); -// // Push the value -// tolua_pushusertype(m_State, p_pValue, "CMeterWindow"); -// // Bind the variable -// lua_settable(m_State, -3); -// -// //lua_pop(m_pLuaScript->GetState(), 1); -//} -//