Skip to content

Commit

Permalink
Win32DisplayWindow: Show window borders in windowed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LupertEverett authored and dpjudas committed Jan 26, 2025
1 parent 00ad31b commit 0005689
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Thirdparty/ZWidget/src/window/win32/win32_display_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ void Win32DisplayWindow::Show()
void Win32DisplayWindow::ShowFullscreen()
{
HDC screenDC = GetDC(0);
DWORD dwStyle = GetWindowLong(WindowHandle.hwnd, GWL_STYLE);
int width = GetDeviceCaps(screenDC, HORZRES);
int height = GetDeviceCaps(screenDC, VERTRES);
ReleaseDC(0, screenDC);
SetWindowLongPtr(WindowHandle.hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
SetWindowLongPtr(WindowHandle.hwnd, GWL_STYLE, WS_OVERLAPPED);
SetWindowLongPtr(WindowHandle.hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos(WindowHandle.hwnd, HWND_TOP, 0, 0, width, height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
Fullscreen = true;
}
Expand All @@ -147,6 +148,7 @@ void Win32DisplayWindow::ShowMinimized()

void Win32DisplayWindow::ShowNormal()
{
SetWindowLongPtr(WindowHandle.hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
ShowWindow(WindowHandle.hwnd, SW_NORMAL);
Fullscreen = false;
}
Expand Down

0 comments on commit 0005689

Please sign in to comment.