Additional change for r1183.

This commit is contained in:
Birunthan Mohanathas
2012-02-15 15:23:28 +00:00
parent 71402a8d48
commit cc211053be
2 changed files with 50 additions and 17 deletions

View File

@ -57,7 +57,7 @@ int RainmeterMain(HINSTANCE hInstance, LPWSTR cmdLine)
{
COPYDATASTRUCT cds;
if (cmdLine && cmdLine[0] == L'!')
if (cmdLine[0] == L'!')
{
// Deliver bang to existing Rainmeter instance
cds.dwData = 1;
@ -84,6 +84,14 @@ int RainmeterMain(HINSTANCE hInstance, LPWSTR cmdLine)
}
}
if (cmdLine[0] == L'!' &&
_wcsicmp(L"!RainmeterQuit", cmdLine) != 0 &&
_wcsicmp(L"!Quit", cmdLine) != 0)
{
MessageBox(NULL, L"Unable to send bang: Rainmeter is not running.", L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR);
return 1;
}
// Avoid loading a dll from current directory
SetDllDirectory(L"");