Skip to content

Commit c38d46b

Browse files
committed
Destroy class on WM_NCDESTROY instead
1 parent 1f7cd73 commit c38d46b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

source/DrawingCanvasControl.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ LRESULT CALLBACK DrawingCanvasControl::WindowProc(HWND hwnd, UINT message, WPARA
9595
}
9696
break;
9797

98-
case WM_DESTROY:
98+
case WM_NCDESTROY:
9999
{
100100
LRESULT result = DefWindowProc(hwnd, message, wParam, lParam);
101101
delete this;

source/MainWindow.ixx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void MainWindow::RegisterCustomClasses()
167167
INITCOMMONCONTROLSEX icex;
168168
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
169169
icex.dwICC = ICC_LISTVIEW_CLASSES;
170-
InitCommonControlsEx(&icex);
170+
InitCommonControlsEx(&icex);
171171

172172
DrawingCanvasControl::RegisterWindowClass(Application::g_hModule);
173173
}
@@ -187,6 +187,7 @@ MainWindow* MainWindow::GetClass(HWND hwnd)
187187

188188
INT_PTR CALLBACK MainWindow::StaticDialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
189189
{
190+
// Create the window the first time.
190191
MainWindow* window = GetClassFromDialog<MainWindow>(hwnd);
191192
if (window == nullptr)
192193
{
@@ -478,10 +479,11 @@ INT_PTR MainWindow::InitializeMainDialog()
478479
// UpdateAttributesListView();
479480
// UpdateAttributeValuesListView();
480481

481-
AppendLog(u"Mouse wheel scrolls, middle button drag pans, right click opens menu, left click selects object (ctrl to toggle). "
482-
u"You can select multiple objects in the list to change an attribute across all.\r\n"
483-
u"Double click cell to edit. Press delete key to delete selected object. Press delete in attribute list to clear value.\r\n"
484-
);
482+
AppendLog(
483+
u"Mouse wheel scrolls, middle button drag pans, right click opens menu, left click selects object (ctrl to toggle). "
484+
u"You can select multiple objects in the list to change an attribute across all.\r\n"
485+
u"Double click cell to edit. Press delete key to delete selected object. Press delete in attribute list to clear value.\r\n"
486+
);
485487

486488
uint32_t controlIdToSetFocusTo = 0;
487489
static_assert(SettingsVisibilityTotal == 3, "");

0 commit comments

Comments
 (0)