[idd] helper: correctly pump message and destroy window

This commit is contained in:
Quantum
2025-09-13 20:57:49 -04:00
committed by Geoffrey McRae
parent 67e1574d20
commit 5c1d604a22
3 changed files with 33 additions and 8 deletions

View File

@@ -60,6 +60,9 @@ LRESULT CWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_CREATE:
onCreate();
return 0;
case WM_NCDESTROY:
PostQuitMessage(0);
return 0;
default:
if (s_taskbarCreated && uMsg == s_taskbarCreated)
{
@@ -89,8 +92,18 @@ void CWindow::registerIcon()
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_ADD)");
}
CWindow::~CWindow()
void CWindow::destroy()
{
if (m_hwnd)
{
DestroyWindow(m_hwnd);
m_hwnd = NULL;
}
}
CWindow::~CWindow()
{
destroy();
}