Skip to content

Commit

Permalink
Update WndMain.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Margen67 committed Dec 17, 2024
1 parent ccc4fb3 commit 8073c8b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/gui/WndMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,6 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
{
case WM_CREATE:
{
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);
}
}

// Set window size to GUI dimensions
ResizeWindow(hwnd, /*bForGUI=*/true);
Expand Down Expand Up @@ -333,6 +320,19 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
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);
}
}
}
break;

Expand Down

0 comments on commit 8073c8b

Please sign in to comment.