chore: Move used code from Win32Hook to MSWindowsHook and remove Win32Hook

This commit is contained in:
sithlord48 2025-03-20 09:42:36 -04:00 committed by Nick Bolton
parent d9798a9b2b
commit 26fa6860e4
6 changed files with 32 additions and 58 deletions

View file

@ -13,7 +13,6 @@ endif()
if(WIN32)
set(PLATFORM_SOURCES
Win32Hook.h
IMSWindowsClipboardFacade.h
MSWindowsClipboard.cpp
MSWindowsClipboard.h

View file

@ -18,8 +18,8 @@
#include "deskflow/win32/AppUtilWindows.h"
#include "mt/Lock.h"
#include "mt/Thread.h"
#include "platform/MSWindowsHook.h"
#include "platform/MSWindowsScreen.h"
#include "platform/Win32Hook.h"
#include <malloc.h>

View file

@ -13,7 +13,6 @@
#include "deskflow/OptionTypes.h"
#include "mt/CondVar.h"
#include "mt/Mutex.h"
#include "platform/Win32Hook.h"
#include <string>

View file

@ -7,11 +7,41 @@
#pragma once
#include "platform/Win32Hook.h"
#include <stdint.h>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define DESKFLOW_MSG_MARK WM_APP + 0x0011 // mark id; <unused>
#define DESKFLOW_MSG_KEY WM_APP + 0x0012 // vk code; key data
#define DESKFLOW_MSG_MOUSE_BUTTON WM_APP + 0x0013 // button msg; <unused>
#define DESKFLOW_MSG_MOUSE_WHEEL WM_APP + 0x0014 // delta; <unused>
#define DESKFLOW_MSG_MOUSE_MOVE WM_APP + 0x0015 // x; y
#define DESKFLOW_MSG_POST_WARP WM_APP + 0x0016 // <unused>; <unused>
#define DESKFLOW_MSG_PRE_WARP WM_APP + 0x0017 // x; y
#define DESKFLOW_MSG_SCREEN_SAVER WM_APP + 0x0018 // activated; <unused>
#define DESKFLOW_MSG_DEBUG WM_APP + 0x0019 // data, data
#define DESKFLOW_MSG_INPUT_FIRST DESKFLOW_MSG_KEY
#define DESKFLOW_MSG_INPUT_LAST DESKFLOW_MSG_PRE_WARP
#define DESKFLOW_HOOK_LAST_MSG DESKFLOW_MSG_DEBUG
#define DESKFLOW_HOOK_FAKE_INPUT_VIRTUAL_KEY VK_CANCEL
#define DESKFLOW_HOOK_FAKE_INPUT_SCANCODE 0
enum EHookResult
{
kHOOK_FAILED,
kHOOK_OKAY,
kHOOK_OKAY_LL
};
enum EHookMode
{
kHOOK_DISABLE,
kHOOK_WATCH_JUMP_ZONE,
kHOOK_RELAY_EVENTS
};
//! Loads and provides functions for the Windows hook
class MSWindowsHook
{

View file

@ -14,7 +14,6 @@
#include "mt/Mutex.h"
#include "platform/MSWindowsHook.h"
#include "platform/MSWindowsPowerManager.h"
#include "platform/Win32Hook.h"
#include <string>

View file

@ -1,53 +0,0 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#pragma once
#include "base/EventTypes.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#if defined(dfwhook_EXPORTS)
#define CDESKFLOWHOOK_API __declspec(dllexport)
#else
#define CDESKFLOWHOOK_API __declspec(dllimport)
#endif
#define DESKFLOW_MSG_MARK WM_APP + 0x0011 // mark id; <unused>
#define DESKFLOW_MSG_KEY WM_APP + 0x0012 // vk code; key data
#define DESKFLOW_MSG_MOUSE_BUTTON WM_APP + 0x0013 // button msg; <unused>
#define DESKFLOW_MSG_MOUSE_WHEEL WM_APP + 0x0014 // delta; <unused>
#define DESKFLOW_MSG_MOUSE_MOVE WM_APP + 0x0015 // x; y
#define DESKFLOW_MSG_POST_WARP WM_APP + 0x0016 // <unused>; <unused>
#define DESKFLOW_MSG_PRE_WARP WM_APP + 0x0017 // x; y
#define DESKFLOW_MSG_SCREEN_SAVER WM_APP + 0x0018 // activated; <unused>
#define DESKFLOW_MSG_DEBUG WM_APP + 0x0019 // data, data
#define DESKFLOW_MSG_INPUT_FIRST DESKFLOW_MSG_KEY
#define DESKFLOW_MSG_INPUT_LAST DESKFLOW_MSG_PRE_WARP
#define DESKFLOW_HOOK_LAST_MSG DESKFLOW_MSG_DEBUG
#define DESKFLOW_HOOK_FAKE_INPUT_VIRTUAL_KEY VK_CANCEL
#define DESKFLOW_HOOK_FAKE_INPUT_SCANCODE 0
extern "C"
{
enum EHookResult
{
kHOOK_FAILED,
kHOOK_OKAY,
kHOOK_OKAY_LL
};
enum EHookMode
{
kHOOK_DISABLE,
kHOOK_WATCH_JUMP_ZONE,
kHOOK_RELAY_EVENTS
};
}