- Fixed an issue that audio commands fail in some cases.

Following cases are now available:

ButtonCommand=PLAY #SKINSPATH#Beeper\Sounds\beep.wav
ButtonCommand=PLAY "#SKINSPATH#Beeper\Sounds\beep.wav"
ButtonCommand=!execute [PLAY #SKINSPATH#Beeper\Sounds\beep.wav]
ButtonCommand=!execute [PLAY "#SKINSPATH#Beeper\Sounds\beep.wav"]
This commit is contained in:
spx
2010-09-02 16:03:15 +00:00
parent e29b2a2d4b
commit 7f2c47a956
4 changed files with 37 additions and 20 deletions

View File

@ -4312,7 +4312,7 @@ LRESULT CMeterWindow::OnDelayedExecute(WPARAM wParam, LPARAM lParam)
COPYDATASTRUCT copyData;
copyData.dwData = 1;
copyData.cbData = (DWORD)((lstrlen(szExecute))* sizeof(WCHAR));
copyData.cbData = (DWORD)((wcslen(szExecute) + 1) * sizeof(WCHAR));
copyData.lpData = (void*)szExecute;
OnCopyData(NULL, (LPARAM)&copyData);
@ -4402,6 +4402,16 @@ LRESULT CMeterWindow::OnCopyData(WPARAM wParam, LPARAM lParam)
}
std::wstring str = (const WCHAR*)pCopyDataStruct->lpData;
if (wcsnicmp(L"PLAY ", str.c_str(), 5) == 0 ||
wcsnicmp(L"PLAYLOOP ", str.c_str(), 9) == 0 ||
wcsnicmp(L"PLAYSTOP", str.c_str(), 8) == 0)
{
// Audio commands are special cases.
Rainmeter->ExecuteCommand(str.c_str(), this);
return TRUE;
}
std::wstring bang;
std::wstring arg;