我具有更改应用程序窗口的窗口/全屏模式的功能:
void sr_WindowToggleFullscreen(void)
{
static WINDOWPLACEMENT windowPrevPlacement;
if (!sr_windowIsFullscreen) {
GetWindowPlacement(hwnd, &windowPrevPlacement);
SetWindowLong(hwnd, GWL_STYLE, WS_BORDER);
SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_TOPMOST);
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
} else {
SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
SetWindowLong(hwnd, GWL_EXSTYLE, 0L);
SetWindowPlacement(hwnd, &windowPrevPlacement);
ShowWindow(hwnd, SW_SHOWDEFAULT);
}
sr_windowIsFullscreen = !sr_windowIsFullscreen;
}
它给出了这样的结果:
如何在全屏模式下将客户区域缩放到屏幕尺寸?像这样: