blob: afff4be704907c1e98fee5751be6fd912b2e9c0f [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
2 *
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
30#define WIN32_LEAN_AND_MEAN
31#include <windows.h>
32
33#define DLLEXPORT __declspec(dllexport)
34
35extern "C"
36{
37 //
38 // -=- Display hook message types
39 //
40
41 DLLEXPORT UINT WM_Hooks_WindowChanged();
42 DLLEXPORT UINT WM_Hooks_WindowBorderChanged();
43 DLLEXPORT UINT WM_Hooks_WindowClientAreaChanged();
44 DLLEXPORT UINT WM_Hooks_RectangleChanged();
45 DLLEXPORT UINT WM_Hooks_CursorChanged();
46
47 //
48 // -=- Display update hooks
49 //
50
51 // - WM_Hooks_Install
52 // Add the current thread to the list of threads that will receive
53 // notifications of changes to the display.
54 // If thread is NULL then the entire display will be hooked.
55 // If thread is !NULL and then the specified
56 // thread will be hooked.
57 // Each thread may only register one hook at a time.
58 // The call will fail (return FALSE) if the thread already has hooks
59 // set, or if the hooks cannot be set, or some other error occurs.
60
61 DLLEXPORT BOOL WM_Hooks_Install(DWORD owner, DWORD thread);
62
63 // - WM_Hooks_Remove
64 // Removes any hook set by the current thread.
65 // The return indicates whether anything went wrong removing the hooks,
66 // that might cause problems later.
67
68 DLLEXPORT BOOL WM_Hooks_Remove(DWORD owner);
69
70 //
71 // -=- User input hooks
72 //
73
74 // - WM_Hooks_EnableRealInputs
75 // If TRUE is passed, then "real" input is enabled, otherwise it is disabled.
76
77 DLLEXPORT BOOL WM_Hooks_EnableRealInputs(BOOL pointer, BOOL keyboard);
78
79 // - WM_Hooks_EnableSynthInputs
80 // If TRUE is passed, then synthetic inputs are enabled, otherwise disabled.
81
82 DLLEXPORT BOOL WM_Hooks_EnableSynthInputs(BOOL pointer, BOOL keyboard);
83
84 //
85 // -=- Cursor shape hooking
86 //
87
88 // - WM_Hooks_EnableCursorShape
89 // If TRUE is passed, then hooks will produce notifications when cursor shape
90 // changes.
91
92 DLLEXPORT BOOL WM_Hooks_EnableCursorShape(BOOL enable);
93
94#ifdef _DEBUG
95 // - WM_Hooks_SetDiagnosticRange
96 // Select a range of messages that will be reported while hooks are active
97 DLLEXPORT void WM_Hooks_SetDiagnosticRange(UINT min, UINT max);
98 DLLEXPORT UINT WM_Hooks_Diagnostic();
99#endif
100
101}
102
103#endif // __WM_HOOKS_H__