Skip to content

Commit

Permalink
make sure the close button is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Sep 18, 2024
1 parent a8aeee1 commit 5d527ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
g_ddraw.render.opengl_y_align = 0;
}

//dbg_dump_wnd_styles(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE), real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE));
dbg_dump_wnd_styles(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE), real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE));
if (g_config.windowed)
{
if (g_config.remove_menu && GetMenu(g_ddraw.hwnd))
Expand Down Expand Up @@ -1057,6 +1057,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
g_ddraw.hwnd,
GWL_STYLE,
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW) & ~(WS_MAXIMIZE));

DWORD class_sytle = GetClassLongA(g_ddraw.hwnd, GCL_STYLE);
if (class_sytle & CS_NOCLOSE)
{
SetClassLongA(g_ddraw.hwnd, GCL_STYLE, class_sytle & ~CS_NOCLOSE);
}
}

LONG exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
Expand Down

0 comments on commit 5d527ca

Please sign in to comment.