CSynergyHook.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef CSYNERGYHOOK_H
00016 #define CSYNERGYHOOK_H
00017 
00018 #include "BasicTypes.h"
00019 #define WIN32_LEAN_AND_MEAN
00020 #include <windows.h>
00021 
00022 #if defined(SYNRGYHK_EXPORTS)
00023 #define CSYNERGYHOOK_API __declspec(dllexport)
00024 #else
00025 #define CSYNERGYHOOK_API __declspec(dllimport)
00026 #endif
00027 
00028 #define SYNERGY_MSG_MARK            WM_APP + 0x0011 // mark id; <unused>
00029 #define SYNERGY_MSG_KEY             WM_APP + 0x0012 // vk code; key data
00030 #define SYNERGY_MSG_MOUSE_BUTTON    WM_APP + 0x0013 // button msg; <unused>
00031 #define SYNERGY_MSG_MOUSE_WHEEL     WM_APP + 0x0014 // delta; <unused>
00032 #define SYNERGY_MSG_MOUSE_MOVE      WM_APP + 0x0015 // x; y
00033 #define SYNERGY_MSG_POST_WARP       WM_APP + 0x0016 // <unused>; <unused>
00034 #define SYNERGY_MSG_PRE_WARP        WM_APP + 0x0017 // x; y
00035 #define SYNERGY_MSG_SCREEN_SAVER    WM_APP + 0x0018 // activated; <unused>
00036 #define SYNERGY_MSG_DEBUG           WM_APP + 0x0019 // data, data
00037 #define SYNERGY_MSG_INPUT_FIRST     SYNERGY_MSG_KEY
00038 #define SYNERGY_MSG_INPUT_LAST      SYNERGY_MSG_PRE_WARP
00039 #define SYNERGY_HOOK_LAST_MSG       SYNERGY_MSG_DEBUG
00040 
00041 #define SYNERGY_HOOK_FAKE_INPUT_VIRTUAL_KEY VK_CANCEL
00042 #define SYNERGY_HOOK_FAKE_INPUT_SCANCODE    0
00043 
00044 extern "C" {
00045 
00046 enum EHookResult {
00047     kHOOK_FAILED,
00048     kHOOK_OKAY,
00049     kHOOK_OKAY_LL
00050 };
00051 
00052 enum EHookMode {
00053     kHOOK_DISABLE,
00054     kHOOK_WATCH_JUMP_ZONE,
00055     kHOOK_RELAY_EVENTS
00056 };
00057 
00058 typedef int             (*InitFunc)(DWORD targetQueueThreadID);
00059 typedef int             (*CleanupFunc)(void);
00060 typedef EHookResult     (*InstallFunc)(void);
00061 typedef int             (*UninstallFunc)(void);
00062 typedef int             (*InstallScreenSaverFunc)(void);
00063 typedef int             (*UninstallScreenSaverFunc)(void);
00064 typedef void            (*SetSidesFunc)(UInt32);
00065 typedef void            (*SetZoneFunc)(SInt32, SInt32, SInt32, SInt32, SInt32);
00066 typedef void            (*SetModeFunc)(int);
00067 
00068 CSYNERGYHOOK_API int    init(DWORD);
00069 CSYNERGYHOOK_API int    cleanup(void);
00070 CSYNERGYHOOK_API EHookResult    install(void);
00071 CSYNERGYHOOK_API int    uninstall(void);
00072 CSYNERGYHOOK_API int    installScreenSaver(void);
00073 CSYNERGYHOOK_API int    uninstallScreenSaver(void);
00074 CSYNERGYHOOK_API void   setSides(UInt32 sides);
00075 CSYNERGYHOOK_API void   setZone(SInt32 x, SInt32 y, SInt32 w, SInt32 h,
00076                             SInt32 jumpZoneSize);
00077 CSYNERGYHOOK_API void   setMode(EHookMode mode);
00078 
00079 }
00080 
00081 #endif

Generated on Fri Nov 6 00:18:45 2009 for synergy-plus by  doxygen 1.4.7