Statement

This commit is contained in:
love-code-yeyixiao 2024-04-19 22:41:38 +08:00
parent edf285e5b7
commit 03a59bb417
3 changed files with 43 additions and 1 deletions

View File

@ -213,6 +213,7 @@ P_AttachThreadInput __sys_AttachThreadInput = NULL;
P_GetOpenFileNameW __sys_GetOpenFileNameW = NULL;
P_ShowCursor __sys_ShowCursor = NULL;
//---------------------------------------------------------------------------
// Functions
@ -506,6 +507,10 @@ _FX BOOLEAN Gui_Init(HMODULE module)
GUI_IMPORT_AW(GetWindowLong);
GUI_IMPORT_AW(SetWindowLong);
GUI_IMPORT_AW(GetClassLong);
GUI_IMPORT___(SetActiveWindow);
GUI_IMPORT___(BringWindowToTop);
GUI_IMPORT___(SwitchToThisWindow);
GUI_IMPORT___(ShowCursor);
#ifdef _WIN64
@ -1370,7 +1375,9 @@ _FX HWND Gui_CreateWindowExW(
else
hWndParent = NULL;
}
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE))
if (dwExStyle & WS_EX_TOPMOST)
dwExStyle = dwExStyle & ~WS_EX_TOPMOST;
//
// create window
//

View File

@ -92,6 +92,14 @@ typedef BOOL (*P_ClipCursor)(const RECT *lpRect);
typedef BOOL (*P_GetClipCursor)(RECT *lpRect);
typedef int(*P_ShowCursor)(BOOL bShow);
typedef BOOL(*P_BringWindowToTop)(HWND hWnd);
typedef void (*P_SwitchToThisWindow)(HWND hWnd, BOOL fAlt);
typedef HWND(*P_SetActiveWindow)(HWND hWnd);
typedef BOOL (*P_GetCursorPos)(LPPOINT lpPoint);
typedef BOOL (*P_SetCursorPos)(int x, int y);
@ -623,6 +631,11 @@ GUI_SYS_VAR_2(DdeInitialize)
GUI_SYS_VAR(BlockInput)
GUI_SYS_VAR(SendInput)
GUI_SYS_VAR(SetActiveWindow);
GUI_SYS_VAR(BringWindowToTop);
GUI_SYS_VAR(ShowCursor);
GUI_SYS_VAR(SwitchToThisWindow);
GUI_SYS_VAR(OpenClipboard)
GUI_SYS_VAR(CloseClipboard)
GUI_SYS_VAR(SetClipboardData);

View File

@ -82,6 +82,14 @@ static void Gui_GetClipboardData_EnhMF(void *buf, ULONG sz, ULONG fmt);
static BOOL Gui_EmptyClipboard();
static int Gui_ShowCursor(BOOL bShow);
static HWND Gui_SetActiveWindow(HWND hWnd);
static BOOL Gui_BringWindowToTop(HWND hWnd);
static BOOL Gui_SwitchToThisWindow(HWND hWnd, BOOL fAlt);
static LONG Gui_ChangeDisplaySettingsExA(
void *lpszDeviceName, void *lpDevMode, HWND hwnd,
DWORD dwflags, void *lParam);
@ -190,6 +198,10 @@ _FX BOOLEAN Gui_InitMisc(HMODULE module)
SBIEDLL_HOOK_GUI(ClipCursor);
SBIEDLL_HOOK_GUI(SwapMouseButton);
SBIEDLL_HOOK_GUI(SetDoubleClickTime);
SBIEDLL_HOOK_GUI(ShowCursor);
SBIEDLL_HOOK_GUI(BringWindowToTop);
SBIEDLL_HOOK_GUI(SwitchToThisWindow);
SBIEDLL_HOOK_GUI(SetActiveWindow);
if (Gui_UseBlockCapture) {
SBIEDLL_HOOK_GUI(GetWindowDC);
@ -1630,3 +1642,13 @@ _FX EXECUTION_STATE Gui_SetThreadExecutionState(EXECUTION_STATE esFlags)
return 0;
//return __sys_SetThreadExecutionState(esFlags);
}
_FX int Gui_ShowCursor(BOOL bShow) {
return __sys_ShowCursor(bShow);
}
_FX HWND Gui_SetActiveWindow(HWND hWnd);
_FX BOOL Gui_BringWindowToTop(HWND hWnd);
_FX BOOL Gui_SwitchToThisWindow(HWND hWnd, BOOL fAlt);