Fixed minor access violation when exiting Rainmeter.

This commit is contained in:
spx 2011-02-05 05:55:01 +00:00
parent 32b0a93a43
commit 1115764ce4

View File

@ -3503,7 +3503,16 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
else else
{ {
// Forward to tray window, which handles all the other commands // 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) catch(CError& error)