From 6c45d0995b8e3a55225f995db0740b8c2594b6fb Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Thu, 5 Oct 2023 00:37:25 +0200 Subject: [PATCH] fix cursor being annoying by @OLEG https://dev.s-ul.net/OLEG/segatools-kancolle/-/commit/95273ccecb30583a6398256682898aa77fdcf8ca --- hooklib/touch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooklib/touch.c b/hooklib/touch.c index 9911514..df6a9ea 100644 --- a/hooklib/touch.c +++ b/hooklib/touch.c @@ -72,6 +72,7 @@ static bool touch_held; static HWND registered_hWnd; static struct touch_screen_config touch_config; static WNDPROC orig_wndProc; +static HCURSOR defaultCursor; static const struct hook_symbol touch_hooks[] = { { @@ -115,6 +116,8 @@ void touch_screen_hook_init(const struct touch_screen_config *cfg, HINSTANCE sel touch_hook_initted = true; + defaultCursor = LoadCursorA(NULL, IDC_CROSS); + memcpy(&touch_config, cfg, sizeof(*cfg)); hook_table_apply(NULL, "user32.dll", touch_hooks, _countof(touch_hooks)); dprintf("TOUCH: hook enabled.\n"); @@ -122,7 +125,7 @@ void touch_screen_hook_init(const struct touch_screen_config *cfg, HINSTANCE sel static HCURSOR WINAPI hook_SetCursor(HCURSOR cursor) { if (cursor == 0 && touch_config.cursor) - return 0; + return next_SetCursor(defaultCursor); return next_SetCursor(cursor); }