Respond to WM_CLOSE in the hidden window so that the installer can

kill us off nice and easily.
This commit is contained in:
Mike Crowe 2006-05-30 20:19:12 +00:00
parent 7cfbedc04c
commit dcd5980fa6
2 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,14 @@ void CNotifyIcon::Destroy()
base::DestroyWindow(); base::DestroyWindow();
} }
void CNotifyIcon::OnClose()
{
// The only time this should happen is if something else explicitly
// sends us the message (such as the installer). We'll just
// exit completely.
GetApplication()->Exit();
}
void CNotifyIcon::PopupBalloon(UINT title_id, UINT text_id, DWORD flags) void CNotifyIcon::PopupBalloon(UINT title_id, UINT text_id, DWORD flags)
{ {
CString title, text; CString title, text;

View File

@ -45,6 +45,7 @@ class CNotifyIcon
MESSAGE_HANDLER(WM_SERVEREVENT, OnServerEvent) MESSAGE_HANDLER(WM_SERVEREVENT, OnServerEvent)
MESSAGE_HANDLER(WM_WTSSESSION_CHANGE, OnSessionChange) MESSAGE_HANDLER(WM_WTSSESSION_CHANGE, OnSessionChange)
MSG_WM_TIMER(OnTimer) MSG_WM_TIMER(OnTimer)
MSG_WM_CLOSE(OnClose)
END_MSG_MAP() END_MSG_MAP()
// Message handlers // Message handlers
@ -56,6 +57,7 @@ class CNotifyIcon
LRESULT OnServerEvent(UINT, WPARAM, LPARAM, BOOL &bHandled); LRESULT OnServerEvent(UINT, WPARAM, LPARAM, BOOL &bHandled);
LRESULT OnSessionChange(UINT, WPARAM, LPARAM, BOOL &bHandled); LRESULT OnSessionChange(UINT, WPARAM, LPARAM, BOOL &bHandled);
void OnTimer(UINT id, TIMERPROC proc); void OnTimer(UINT id, TIMERPROC proc);
void OnClose();
void PopupBalloon(UINT title_id, UINT text_id, DWORD flags = NIIF_INFO); void PopupBalloon(UINT title_id, UINT text_id, DWORD flags = NIIF_INFO);