From 913cf05a1813078975b70db53164ac9b5a7ea7e1 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sat, 4 Feb 2012 14:29:51 +0000 Subject: [PATCH] Additional change for r1166. --- Library/Export.cpp | 5 ++++- Library/Rainmeter.cpp | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Library/Export.cpp b/Library/Export.cpp index 9ae9b071..d676a664 100644 --- a/Library/Export.cpp +++ b/Library/Export.cpp @@ -88,7 +88,10 @@ void* __stdcall RmGet(void* rm, int type) void __stdcall RmExecute(void* skin, LPCWSTR command) { CMeterWindow* mw = (CMeterWindow*)skin; - Rainmeter->ExecuteCommand(command, mw); + if (command) + { + Rainmeter->ExecuteCommand(command, mw); + } } BOOL LSLog(int nLevel, LPCWSTR unused, LPCWSTR pszMessage) diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 0c04c880..9c006c37 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -1899,6 +1899,7 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow) if (meterWindow) { + meterWindow->GetParser().ReplaceMeasures(sound); meterWindow->MakePathAbsolute(sound); } @@ -1914,7 +1915,16 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow) } // Run command - RunCommand(NULL, command, SW_SHOWNORMAL); + if (meterWindow) + { + std::wstring tmpSz = command; + meterWindow->GetParser().ReplaceMeasures(tmpSz); + RunCommand(NULL, tmpSz.c_str(), SW_SHOWNORMAL); + } + else + { + RunCommand(NULL, command, SW_SHOWNORMAL); + } } }