Windows: Maximize to Borderless Maximize
Moderator: InsideQC Admins
1 post
• Page 1 of 1
Windows: Maximize to Borderless Maximize
I like to be able to resize the window in Windows, but when the window is maximized I want essentially "full screen".
Except I don't want full screen if, say, the console (or really the menu) is up. Especially since you can't get out of full-screen maximized size without it.
This link was very helpful, with bits and pieces of this both right and wrong all over the internet in a frustrating way.
[This gets called from within the window resize function, so if going to full screen maximized or the reverse changes something, that change does get recorded right after exiting the function.]
Except I don't want full screen if, say, the console (or really the menu) is up. Especially since you can't get out of full-screen maximized size without it.
This link was very helpful, with bits and pieces of this both right and wrong all over the internet in a frustrating way.
[This gets called from within the window resize function, so if going to full screen maximized or the reverse changes something, that change does get recorded right after exiting the function.]
- Code: Select all
void Platform_Window_Check_Maximized (void)
{
static fbool oldSuperMaximized = False;
static fbool oldMaximized = False;
static WINDOWPLACEMENT wpPrev = { sizeof(wpPrev) };
{
// We super maximize when maximized, no console, and non already supermaximized
// We un-super maximize when supermaximized, maximized, console is showing.
fbool Action = False;
if (oldSuperMaximized == False && !host.isConsoleUp /*&& oldMaximized*/ && host.isMaximized)
{
// Go to super-maximized
DWORD dwStyle = GetWindowLong(w32_plat.mainwindow, GWL_STYLE);
if (dwStyle & WS_OVERLAPPEDWINDOW)
{
GetWindowPlacement (w32_plat.mainwindow, &wpPrev);
SetWindowLong (w32_plat.mainwindow, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos (w32_plat.mainwindow, HWND_TOP, 0, 0, host.deviceWidth, host.deviceHeight, SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
oldSuperMaximized = True;
}
oldSuperMaximized = True;
Action = True;
}
else if (oldSuperMaximized == True && host.isConsoleUp && host.isMaximized /*&& oldMaximized == True*/)
{
DWORD dwStyle = GetWindowLong(w32_plat.mainwindow, GWL_STYLE);
SetWindowLong (w32_plat.mainwindow, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
SetWindowPlacement(w32_plat.mainwindow, &wpPrev);
SetWindowPos (
w32_plat.mainwindow,
NULL,
0,0,0,0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED
);
oldSuperMaximized = False;
Action = True;
}
oldMaximized = host.isMaximized;
}
}
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest