Small change about !RainmeterQuit (simpler way)

This commit is contained in:
spx 2010-04-02 06:54:51 +00:00
parent 415c905d0a
commit 8bff3e2ac2
3 changed files with 2 additions and 11 deletions

View File

@ -640,7 +640,7 @@ void RainmeterQuit(HWND, const char* arg)
if (Rainmeter) if (Rainmeter)
{ {
// Quit needs to be delayed since it crashes if done during Update() // Quit needs to be delayed since it crashes if done during Update()
PostMessage(Rainmeter->GetTrayWindow()->GetWindow(), WM_DELAYED_QUIT, (WPARAM)NULL, (LPARAM)NULL); PostMessage(Rainmeter->GetTrayWindow()->GetWindow(), WM_COMMAND, MAKEWPARAM(ID_CONTEXT_QUIT, 0), (LPARAM)NULL);
} }
} }
@ -1781,7 +1781,7 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
else if (wcsicmp(bang.c_str(), L"!RainmeterQuit") == 0) else if (wcsicmp(bang.c_str(), L"!RainmeterQuit") == 0)
{ {
// Quit needs to be delayed since it crashes if done during Update() // Quit needs to be delayed since it crashes if done during Update()
PostMessage(m_TrayWindow->GetWindow(), WM_DELAYED_QUIT, (WPARAM)NULL, (LPARAM)NULL); PostMessage(m_TrayWindow->GetWindow(), WM_COMMAND, MAKEWPARAM(ID_CONTEXT_QUIT, 0), (LPARAM)NULL);
} }
else if (wcsicmp(bang.c_str(), L"!Execute") == 0) else if (wcsicmp(bang.c_str(), L"!Execute") == 0)
{ {

View File

@ -631,14 +631,6 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
} }
return 0; return 0;
case WM_DELAYED_QUIT:
if (Rainmeter)
{
if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0);
quitModule(Rainmeter->GetInstance());
}
return 0;
case WM_DESTROY: case WM_DESTROY:
if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0); if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0);
break; break;

View File

@ -25,7 +25,6 @@
#include "Measure.h" #include "Measure.h"
#define WM_DELAYED_REFRESH_ALL WM_APP + 0 #define WM_DELAYED_REFRESH_ALL WM_APP + 0
#define WM_DELAYED_QUIT WM_APP + 1
#define WM_NOTIFYICON WM_USER + 101 #define WM_NOTIFYICON WM_USER + 101
#define TRAYICON_SIZE 16 #define TRAYICON_SIZE 16