Add an option to strip window of it's borders to improve multi with 1 display.

This commit is contained in:
LunaMoo committed 2019-05-05 18:28:02 +02:00
1 parent df1e967733
commit 9b0b23934a
6 files changed
+61 -1

No files matched your search

+30
View File
@@ -381,6 +381,17 @@ namespace MainWindow
if (g_Config.bDisableWinMenu)
SetMenu(hwndMain, NULL);
if (g_Config.bDisableWinBorders) {
LONG lStyle = GetWindowLongPtr(hwndMain, GWL_STYLE);
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU);
SetWindowLongPtr(hwndMain, GWL_STYLE, lStyle);
LONG lExStyle = GetWindowLongPtr(hwndMain, GWL_EXSTYLE);
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);
SetWindowLongPtr(hwndMain, GWL_EXSTYLE, lExStyle);
SetWindowPos(hwndMain, NULL, g_Config.iWindowX, g_Config.iWindowY, g_Config.iWindowWidth, g_Config.iWindowHeight, SWP_NOZORDER);
}
}
void Minimize() {
@@ -460,6 +471,25 @@ namespace MainWindow
windowTitle = title;
}
void SetWindowXXYY() {
const int currentScreenWidth = GetSystemMetrics(SM_CXSCREEN);
const int currentScreenHeight = GetSystemMetrics(SM_CYSCREEN);
if (g_Config.iWindowWidth > currentScreenWidth)
g_Config.iWindowWidth = currentScreenWidth;
if (g_Config.iWindowHeight > currentScreenHeight)
g_Config.iWindowHeight = currentScreenHeight;
if (g_Config.iWindowX > (currentScreenWidth - g_Config.iWindowWidth))
g_Config.iWindowX = currentScreenWidth - g_Config.iWindowWidth;
if (g_Config.iWindowY > (currentScreenHeight - g_Config.iWindowHeight))
g_Config.iWindowY = currentScreenHeight - g_Config.iWindowHeight;
if (g_Config.iWindowX < 0)
g_Config.iWindowX = 0;
if (g_Config.iWindowY < 0)
g_Config.iWindowY = 0;
MoveWindow(hwndMain, g_Config.iWindowX, g_Config.iWindowY, g_Config.iWindowWidth, g_Config.iWindowHeight, TRUE);
g_Config.Save("SetWindowXXYY");
}
BOOL Show(HINSTANCE hInstance) {
hInst = hInstance; // Store instance handle in our global variable.
RECT rc = DetermineWindowRectangle();