From 2da1352c75b17397ca33c299757e1f7b58e700d6 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sat, 20 Apr 2024 14:37:24 +0800 Subject: [PATCH] Add another hook. --- Sandboxie/core/dll/gui.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Sandboxie/core/dll/gui.c b/Sandboxie/core/dll/gui.c index 62359f6f..d8788290 100644 --- a/Sandboxie/core/dll/gui.c +++ b/Sandboxie/core/dll/gui.c @@ -1938,6 +1938,20 @@ _FX BOOL Gui_MoveWindow( SetLastError(ERROR_INVALID_WINDOW_HANDLE); return FALSE; } + if (SbieApi_QueryConfBool(NULL, L"BlockInterferenceControl", FALSE)) { + RECT rt; + typedef (*P_SystemParametersInfoA)(UINT uiAction, + UINT uiParam, + PVOID pvParam, + UINT fWinIni); + typedef (*P_GetSystemMetrics)(int nIndex); + 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; + SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0); + int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom; + if (y + h > y1) + h = y1 - y - GetSystemMetrics(4); + } return __sys_MoveWindow(hWnd, x, y, w, h, bRepaint); } @@ -1974,7 +1988,7 @@ _FX BOOL Gui_SetWindowPos( SystemParametersInfoA(SPI_GETWORKAREA, 0, &rt, 0); int y1 = GetSystemMetrics(SM_CYSCREEN) - rt.bottom; if (y+h > y1) - h = y1-y; + h = y1-y - GetSystemMetrics(4); } then: if (Gui_UseProxyService && !Gui_IsSameBox(hWnd, NULL, NULL)) {