ExternalWindowTracker.h 743 B

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