This commit is contained in:
love-code-yeyixiao 2024-04-20 15:42:30 +08:00
parent 295cb404ae
commit 93699b5dc0
1 changed files with 15 additions and 2 deletions

View File

@ -1949,8 +1949,15 @@ _FX BOOL Gui_MoveWindow(
P_GetSystemMetrics GetSystemMetrics = Ldr_GetProcAddrNew("user32.dll", "GetSystemMetrics", "GetSystemMetrics"); if (!GetSystemMetrics) goto then; P_GetSystemMetrics GetSystemMetrics = Ldr_GetProcAddrNew("user32.dll", "GetSystemMetrics", "GetSystemMetrics"); if (!GetSystemMetrics) goto then;
SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0); SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0);
int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom; int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom;
int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom, x1 = GetSystemMetrics(SM_CXSCREEN) - rt.right, y2 = GetSystemMetrics(SM_CYSCREEN) - rt.top, x2 = GetSystemMetrics(SM_CXSCREEN) - rt.left;
if (y + h > y1) if (y + h > y1)
h = y1 - y-2; h = y1 - y - 2;
if (y < y2)
y = y2 + 2;
if (x + w > x1)
w = x1 - x;
if (x < x2)
x = x2 + 2;
} }
then: then:
return __sys_MoveWindow(hWnd, x, y, w, h, bRepaint); return __sys_MoveWindow(hWnd, x, y, w, h, bRepaint);
@ -1987,9 +1994,15 @@ _FX BOOL Gui_SetWindowPos(
P_SystemParametersInfoA SystemParametersInfoA = Ldr_GetProcAddrNew("user32.dll", "SystemParametersInfoA", "SystemParametersInfoA"); if (!SystemParametersInfoA) goto then; P_SystemParametersInfoA SystemParametersInfoA = Ldr_GetProcAddrNew("user32.dll", "SystemParametersInfoA", "SystemParametersInfoA"); if (!SystemParametersInfoA) goto then;
P_GetSystemMetrics GetSystemMetrics = Ldr_GetProcAddrNew("user32.dll", "GetSystemMetrics", "GetSystemMetrics"); if (!GetSystemMetrics) goto then; P_GetSystemMetrics GetSystemMetrics = Ldr_GetProcAddrNew("user32.dll", "GetSystemMetrics", "GetSystemMetrics"); if (!GetSystemMetrics) goto then;
SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0); SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0);
int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom; int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom,x1= GetSystemMetrics(SM_CXSCREEN)-rt.right, y2 = GetSystemMetrics(SM_CYSCREEN) - rt.top, x2 = GetSystemMetrics(SM_CXSCREEN) - rt.left;
if (y+h > y1) if (y+h > y1)
h = y1-y - 2; h = y1-y - 2;
if (y < y2)
y = y2 + 2;
if (x + w > x1)
w = x1 - x;
if (x < x2)
x = x2+2;
} }
then: then:
if (Gui_UseProxyService && !Gui_IsSameBox(hWnd, NULL, NULL)) { if (Gui_UseProxyService && !Gui_IsSameBox(hWnd, NULL, NULL)) {