From 1115764ce41e4a5afb54936f82e2943fa892ecc3 Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 5 Feb 2011 05:55:01 +0000 Subject: [PATCH] Fixed minor access violation when exiting Rainmeter. --- Library/MeterWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 96a51e7b..f4ef161e 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -3503,7 +3503,16 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) else { // Forward to tray window, which handles all the other commands - SendMessage(m_Rainmeter->GetTrayWindow()->GetWindow(), WM_COMMAND, wParam, lParam); + HWND tray = m_Rainmeter->GetTrayWindow()->GetWindow(); + + if (wParam == ID_CONTEXT_QUIT) + { + PostMessage(tray, WM_COMMAND, wParam, lParam); + } + else + { + SendMessage(tray, WM_COMMAND, wParam, lParam); + } } } catch(CError& error)