Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

WMPoller.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. // -=- WMPoller.h
  19. //
  20. // Polls the foreground window. If the pollOnlyConsoles flag is set,
  21. // then checks the window class of the foreground window first and
  22. // only polls it if it's a console.
  23. // If the pollAllWindows flag is set then iterates through visible
  24. // windows, and polls the visible bits. If pollOnlyConsoles is also
  25. // set then only visible parts of console windows will be polled.
  26. #ifndef __RFB_WIN32_WM_POLLER_H__
  27. #define __RFB_WIN32_WM_POLLER_H__
  28. #include <windows.h>
  29. #include <rfb/UpdateTracker.h>
  30. #include <rfb/Configuration.h>
  31. namespace rfb {
  32. namespace win32 {
  33. class WMPoller {
  34. public:
  35. WMPoller() : ut(0) {}
  36. bool processEvent();
  37. bool setUpdateTracker(UpdateTracker* ut);
  38. static BoolParameter poll_console_windows;
  39. protected:
  40. struct PollInfo {
  41. Region poll_include;
  42. Region poll_exclude;
  43. };
  44. static bool checkPollWindow(HWND w);
  45. static void pollWindow(HWND w, PollInfo* info);
  46. static BOOL CALLBACK enumWindowProc(HWND w, LPARAM lp);
  47. UpdateTracker* ut;
  48. };
  49. };
  50. };
  51. #endif // __RFB_WIN32_WM_POLLER_H__