You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wm_hooks.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Copyright (C) 2002-2005 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. // -=- wm_hooks.h
  19. //
  20. // Window Message Hooks Dynamic Link library
  21. //
  22. // This interface is used by the WMHooks class in rfb_win32 to hook the
  23. // windows on the desktop and receive notifications of changes in their
  24. // state.
  25. #ifndef __WM_HOOKS_H__
  26. #define __WM_HOOKS_H__
  27. #include <windows.h>
  28. #define DLLEXPORT __declspec(dllexport)
  29. extern "C"
  30. {
  31. //
  32. // -=- Display hook message types
  33. //
  34. DLLEXPORT UINT WM_Hooks_WindowChanged();
  35. DLLEXPORT UINT WM_Hooks_WindowBorderChanged();
  36. DLLEXPORT UINT WM_Hooks_WindowClientAreaChanged();
  37. DLLEXPORT UINT WM_Hooks_RectangleChanged();
  38. DLLEXPORT UINT WM_Hooks_CursorChanged();
  39. //
  40. // -=- Display update hooks
  41. //
  42. // - WM_Hooks_Install
  43. // Add the current thread to the list of threads that will receive
  44. // notifications of changes to the display.
  45. // If thread is NULL then the entire display will be hooked.
  46. // If thread is !NULL and then the specified
  47. // thread will be hooked.
  48. // Each thread may only register one hook at a time.
  49. // The call will fail (return FALSE) if the thread already has hooks
  50. // set, or if the hooks cannot be set, or some other error occurs.
  51. DLLEXPORT BOOL WM_Hooks_Install(DWORD owner, DWORD thread);
  52. // - WM_Hooks_Remove
  53. // Removes any hook set by the current thread.
  54. // The return indicates whether anything went wrong removing the hooks,
  55. // that might cause problems later.
  56. DLLEXPORT BOOL WM_Hooks_Remove(DWORD owner);
  57. //
  58. // -=- User input hooks
  59. //
  60. // - WM_Hooks_EnableRealInputs
  61. // If TRUE is passed, then "real" input is enabled, otherwise it is disabled.
  62. DLLEXPORT BOOL WM_Hooks_EnableRealInputs(BOOL pointer, BOOL keyboard);
  63. // - WM_Hooks_EnableSynthInputs
  64. // If TRUE is passed, then synthetic inputs are enabled, otherwise disabled.
  65. DLLEXPORT BOOL WM_Hooks_EnableSynthInputs(BOOL pointer, BOOL keyboard);
  66. //
  67. // -=- Cursor shape hooking
  68. //
  69. // - WM_Hooks_EnableCursorShape
  70. // If TRUE is passed, then hooks will produce notifications when cursor shape
  71. // changes.
  72. DLLEXPORT BOOL WM_Hooks_EnableCursorShape(BOOL enable);
  73. #ifdef _DEBUG
  74. // - WM_Hooks_SetDiagnosticRange
  75. // Select a range of messages that will be reported while hooks are active
  76. DLLEXPORT void WM_Hooks_SetDiagnosticRange(UINT min, UINT max);
  77. DLLEXPORT UINT WM_Hooks_Diagnostic();
  78. #endif
  79. }
  80. #endif // __WM_HOOKS_H__