Constantin Kaplinsky | 7d86cd1 | 2006-05-11 04:39:38 +0000 | [diff] [blame^] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
| 2 | * |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | */ |
| 18 | |
| 19 | // -=- wm_hooks.h |
| 20 | // |
| 21 | // Window Message Hooks Dynamic Link library |
| 22 | // |
| 23 | // This interface is used by the WMHooks class in rfb_win32 to hook the |
| 24 | // windows on the desktop and receive notifications of changes in their |
| 25 | // state. |
| 26 | |
| 27 | #ifndef __WM_HOOKS_H__ |
| 28 | #define __WM_HOOKS_H__ |
| 29 | |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 30 | #include <windows.h> |
| 31 | |
| 32 | #define DLLEXPORT __declspec(dllexport) |
| 33 | |
| 34 | extern "C" |
| 35 | { |
| 36 | // |
| 37 | // -=- Display hook message types |
| 38 | // |
| 39 | |
| 40 | DLLEXPORT UINT WM_Hooks_WindowChanged(); |
| 41 | DLLEXPORT UINT WM_Hooks_WindowBorderChanged(); |
| 42 | DLLEXPORT UINT WM_Hooks_WindowClientAreaChanged(); |
| 43 | DLLEXPORT UINT WM_Hooks_RectangleChanged(); |
| 44 | DLLEXPORT UINT WM_Hooks_CursorChanged(); |
| 45 | |
| 46 | // |
| 47 | // -=- Display update hooks |
| 48 | // |
| 49 | |
| 50 | // - WM_Hooks_Install |
| 51 | // Add the current thread to the list of threads that will receive |
| 52 | // notifications of changes to the display. |
| 53 | // If thread is NULL then the entire display will be hooked. |
| 54 | // If thread is !NULL and then the specified |
| 55 | // thread will be hooked. |
| 56 | // Each thread may only register one hook at a time. |
| 57 | // The call will fail (return FALSE) if the thread already has hooks |
| 58 | // set, or if the hooks cannot be set, or some other error occurs. |
| 59 | |
| 60 | DLLEXPORT BOOL WM_Hooks_Install(DWORD owner, DWORD thread); |
| 61 | |
| 62 | // - WM_Hooks_Remove |
| 63 | // Removes any hook set by the current thread. |
| 64 | // The return indicates whether anything went wrong removing the hooks, |
| 65 | // that might cause problems later. |
| 66 | |
| 67 | DLLEXPORT BOOL WM_Hooks_Remove(DWORD owner); |
| 68 | |
| 69 | // |
| 70 | // -=- User input hooks |
| 71 | // |
| 72 | |
| 73 | // - WM_Hooks_EnableRealInputs |
| 74 | // If TRUE is passed, then "real" input is enabled, otherwise it is disabled. |
| 75 | |
| 76 | DLLEXPORT BOOL WM_Hooks_EnableRealInputs(BOOL pointer, BOOL keyboard); |
| 77 | |
| 78 | // - WM_Hooks_EnableSynthInputs |
| 79 | // If TRUE is passed, then synthetic inputs are enabled, otherwise disabled. |
| 80 | |
| 81 | DLLEXPORT BOOL WM_Hooks_EnableSynthInputs(BOOL pointer, BOOL keyboard); |
| 82 | |
| 83 | // |
| 84 | // -=- Cursor shape hooking |
| 85 | // |
| 86 | |
| 87 | // - WM_Hooks_EnableCursorShape |
| 88 | // If TRUE is passed, then hooks will produce notifications when cursor shape |
| 89 | // changes. |
| 90 | |
| 91 | DLLEXPORT BOOL WM_Hooks_EnableCursorShape(BOOL enable); |
| 92 | |
| 93 | #ifdef _DEBUG |
| 94 | // - WM_Hooks_SetDiagnosticRange |
| 95 | // Select a range of messages that will be reported while hooks are active |
| 96 | DLLEXPORT void WM_Hooks_SetDiagnosticRange(UINT min, UINT max); |
| 97 | DLLEXPORT UINT WM_Hooks_Diagnostic(); |
| 98 | #endif |
| 99 | |
| 100 | } |
| 101 | |
| 102 | #endif // __WM_HOOKS_H__ |