ExternalWindowTracker.h 884 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. bool DesktopHasFocus() const { return m_desktopHasFocus; }
  12. CString ActiveWndName();
  13. CString WndName(HWND hWnd);
  14. bool TrackActiveWnd(bool force);
  15. bool ActivateTarget();
  16. bool ReleaseFocus();
  17. CPoint FocusCaret();
  18. void SendPaste(bool activateTarget);
  19. void SendCut();
  20. void SendCopy(CopyReasonEnum::CopyReason copyReason);
  21. bool NotifyTrayhWnd(HWND hWnd);
  22. protected:
  23. HWND m_activeWnd;
  24. HWND m_focusWnd;
  25. bool m_dittoHasFocus;
  26. bool m_desktopHasFocus;
  27. protected:
  28. bool WaitForActiveWnd(HWND hwndToHaveFocus, int timeout);
  29. void ActivateFocus(const HWND active_wnd, const HWND focus_wnd);
  30. };