Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
MSWindowsHook.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2011 Chris Schoeneman
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include <stdint.h>
11
12#define WIN32_LEAN_AND_MEAN
13#include <Windows.h>
14
15#define DESKFLOW_MSG_MARK WM_APP + 0x0011 // mark id; <unused>
16#define DESKFLOW_MSG_KEY WM_APP + 0x0012 // vk code; key data
17#define DESKFLOW_MSG_MOUSE_BUTTON WM_APP + 0x0013 // button msg; <unused>
18#define DESKFLOW_MSG_MOUSE_WHEEL WM_APP + 0x0014 // delta; <unused>
19#define DESKFLOW_MSG_MOUSE_MOVE WM_APP + 0x0015 // x; y
20#define DESKFLOW_MSG_POST_WARP WM_APP + 0x0016 // <unused>; <unused>
21#define DESKFLOW_MSG_PRE_WARP WM_APP + 0x0017 // x; y
22#define DESKFLOW_MSG_SCREEN_SAVER WM_APP + 0x0018 // activated; <unused>
23#define DESKFLOW_MSG_DEBUG WM_APP + 0x0019 // data, data
24#define DESKFLOW_MSG_INPUT_FIRST DESKFLOW_MSG_KEY
25#define DESKFLOW_MSG_INPUT_LAST DESKFLOW_MSG_PRE_WARP
26#define DESKFLOW_HOOK_LAST_MSG DESKFLOW_MSG_DEBUG
27
28#define DESKFLOW_HOOK_FAKE_INPUT_VIRTUAL_KEY VK_CANCEL
29#define DESKFLOW_HOOK_FAKE_INPUT_SCANCODE 0
30
37
44
47{
48public:
49 MSWindowsHook() = default;
51
52 void loadLibrary();
53
54 int init(DWORD threadID);
55
56 int cleanup();
57
58 void setSides(uint32_t sides);
59 uint32_t getSides();
60
61 void setZone(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize);
62
63 void setMode(EHookMode mode);
64
65 static EHookResult install();
66
67 static int uninstall();
68
69 static int installScreenSaver();
70
71 static int uninstallScreenSaver();
72};
static const WSAEVENT FAR DWORD
Definition ArchNetworkWinsock.cpp:54
EHookMode
Definition MSWindowsHook.h:39
@ kHOOK_WATCH_JUMP_ZONE
Definition MSWindowsHook.h:41
@ kHOOK_DISABLE
Definition MSWindowsHook.h:40
@ kHOOK_RELAY_EVENTS
Definition MSWindowsHook.h:42
EHookResult
Definition MSWindowsHook.h:32
@ kHOOK_FAILED
Definition MSWindowsHook.h:33
@ kHOOK_OKAY_LL
Definition MSWindowsHook.h:35
@ kHOOK_OKAY
Definition MSWindowsHook.h:34
int y
Definition ServerConfig.cpp:27
int x
Definition ServerConfig.cpp:26
void setMode(EHookMode mode)
Definition MSWindowsHook.cpp:132
void setZone(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize)
Definition MSWindowsHook.cpp:123
void loadLibrary()
Definition MSWindowsHook.cpp:48
int cleanup()
Definition MSWindowsHook.cpp:104
static int uninstallScreenSaver()
Definition MSWindowsHook.cpp:698
uint32_t getSides()
Definition MSWindowsHook.cpp:118
static int installScreenSaver()
Definition MSWindowsHook.cpp:680
void setSides(uint32_t sides)
Definition MSWindowsHook.cpp:113
static EHookResult install()
Definition MSWindowsHook.cpp:592
int init(DWORD threadID)
Definition MSWindowsHook.cpp:62
static int uninstall()
Definition MSWindowsHook.cpp:642
~MSWindowsHook()
Definition MSWindowsHook.cpp:37
MSWindowsHook()=default