diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index be120eabdd..084e0939e4 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -319,21 +319,21 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ChangeWindowMessageFilterEx(hwnd, WM_COPYDATA, MSGFLT_ALLOW, nullptr); ChangeWindowMessageFilterEx(hwnd, 0x0049, MSGFLT_ALLOW, nullptr); - m_bCreated = true; - if (hwnd) - { - // Remove rounded corners from the render window on Windows 11 - const DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND; - DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference, - sizeof(corner_preference)); - // initialize menu - { - HMENU hMenu = LoadMenu(m_hInstance, MAKEINTRESOURCE(IDR_MAINMENU)); - - SetMenu(hwnd, hMenu); - } + if (hwnd) + { + // Remove rounded corners from the render window on Windows 11 + const DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND; + DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference, + sizeof(corner_preference)); + // initialize menu + { + HMENU hMenu = LoadMenu(m_hInstance, MAKEINTRESOURCE(IDR_MAINMENU)); + + SetMenu(hwnd, hMenu); + } + } } - } + m_bCreated = true; break; // NOTE: WM_PARENTNOTIFY was triggered by kernel process' graphic window creation.