1 /*
2  * synergy -- mouse and keyboard sharing utility
3  * Copyright (C) 2012-2016 Symless Ltd.
4  * Copyright (C) 2002 Chris Schoeneman
5  *
6  * This package is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * found in the file LICENSE that should have accompanied this file.
9  *
10  * This package is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 // hack: vs2005 doesn't declare _WIN32_WINNT, so we need to hard code it.
22 // however, some say that this should be hard coded since it defines the
23 // target system, but since this is suposed to compile on pre-XP, maybe
24 // we should just leave it like this.
25 #if _MSC_VER == 1400
26 #define _WIN32_WINNT 0x0400
27 #endif
28 
29 #include "base/EventTypes.h"
30 
31 #define WIN32_LEAN_AND_MEAN
32 #include <Windows.h>
33 
34 #if defined(synwinhk_EXPORTS)
35 #define CSYNERGYHOOK_API __declspec(dllexport)
36 #else
37 #define CSYNERGYHOOK_API __declspec(dllimport)
38 #endif
39 
40 #define SYNERGY_MSG_MARK            WM_APP + 0x0011    // mark id; <unused>
41 #define SYNERGY_MSG_KEY                WM_APP + 0x0012    // vk code; key data
42 #define SYNERGY_MSG_MOUSE_BUTTON    WM_APP + 0x0013    // button msg; <unused>
43 #define SYNERGY_MSG_MOUSE_WHEEL        WM_APP + 0x0014    // delta; <unused>
44 #define SYNERGY_MSG_MOUSE_MOVE        WM_APP + 0x0015    // x; y
45 #define SYNERGY_MSG_POST_WARP        WM_APP + 0x0016    // <unused>; <unused>
46 #define SYNERGY_MSG_PRE_WARP        WM_APP + 0x0017    // x; y
47 #define SYNERGY_MSG_SCREEN_SAVER    WM_APP + 0x0018    // activated; <unused>
48 #define SYNERGY_MSG_DEBUG            WM_APP + 0x0019    // data, data
49 #define SYNERGY_MSG_INPUT_FIRST        SYNERGY_MSG_KEY
50 #define SYNERGY_MSG_INPUT_LAST        SYNERGY_MSG_PRE_WARP
51 #define SYNERGY_HOOK_LAST_MSG        SYNERGY_MSG_DEBUG
52 
53 #define SYNERGY_HOOK_FAKE_INPUT_VIRTUAL_KEY    VK_CANCEL
54 #define SYNERGY_HOOK_FAKE_INPUT_SCANCODE    0
55 
56 extern "C" {
57 
58 enum EHookResult {
59     kHOOK_FAILED,
60     kHOOK_OKAY,
61     kHOOK_OKAY_LL
62 };
63 
64 enum EHookMode {
65     kHOOK_DISABLE,
66     kHOOK_WATCH_JUMP_ZONE,
67     kHOOK_RELAY_EVENTS
68 };
69 
70 }
71