diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index fcbbef16..f1708145 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -640,7 +640,7 @@ void RainmeterQuit(HWND, const char* arg) if (Rainmeter) { // 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) { // 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) { diff --git a/Library/TrayWindow.cpp b/Library/TrayWindow.cpp index 59322b14..bf2ec664 100644 --- a/Library/TrayWindow.cpp +++ b/Library/TrayWindow.cpp @@ -631,14 +631,6 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } return 0; - case WM_DELAYED_QUIT: - if (Rainmeter) - { - if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0); - quitModule(Rainmeter->GetInstance()); - } - return 0; - case WM_DESTROY: if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0); break; diff --git a/Library/TrayWindow.h b/Library/TrayWindow.h index ecc5f7c3..5db8dcd6 100644 --- a/Library/TrayWindow.h +++ b/Library/TrayWindow.h @@ -25,7 +25,6 @@ #include "Measure.h" #define WM_DELAYED_REFRESH_ALL WM_APP + 0 -#define WM_DELAYED_QUIT WM_APP + 1 #define WM_NOTIFYICON WM_USER + 101 #define TRAYICON_SIZE 16