ExternalWindowTracker.h 799 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "Misc.h"
  3. class ExternalWindowTracker
  4. {
  5. public:
  6. ExternalWindowTracker(void);
  7. ~ExternalWindowTracker(void);
  8. HWND ActiveWnd() const { return m_activeWnd; }
  9. HWND FocusWnd() const { return m_focusWnd; }
  10. bool DittoHasFocus() const { return m_dittoHasFocus; }
  11. CString ActiveWndName();
  12. CString WndName(HWND hWnd);
  13. bool TrackActiveWnd(bool force);
  14. bool ActivateTarget();
  15. bool ReleaseFocus();
  16. CPoint FocusCaret();
  17. void SendPaste(bool activateTarget);
  18. void SendCut();
  19. void SendCopy(CopyReasonEnum::CopyReason copyReason);
  20. bool NotifyTrayhWnd(HWND hWnd);
  21. protected:
  22. HWND m_activeWnd;
  23. HWND m_focusWnd;
  24. bool m_dittoHasFocus;
  25. protected:
  26. bool WaitForActiveWnd(HWND hwndToHaveFocus, int timeout);
  27. void ActivateFocus(const HWND active_wnd, const HWND focus_wnd);
  28. };