ClipboardViewer.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #if !defined(AFX_CLIPBOARDVIEWER_H__67418FB6_6048_48FA_86D4_F412CACC41B1__INCLUDED_)
  2. #define AFX_CLIPBOARDVIEWER_H__67418FB6_6048_48FA_86D4_F412CACC41B1__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. #define TIMER_ENSURE_VIEWER_IN_CHAIN 6
  7. #define TIMER_DRAW_CLIPBOARD 7
  8. #define TIMER_PING 8
  9. class CClipboardViewer : public CWnd
  10. {
  11. // Construction
  12. public:
  13. CClipboardViewer(CCopyThread* pHandler);
  14. virtual ~CClipboardViewer();
  15. // Overrides
  16. // ClassWizard generated virtual function overrides
  17. //{{AFX_VIRTUAL(CClipboardViewer)
  18. //}}AFX_VIRTUAL
  19. // Implementation
  20. public:
  21. void Create();
  22. HWND m_hNextClipboardViewer;
  23. bool m_bCalling_SetClipboardViewer;
  24. bool m_bPinging;
  25. bool m_bConnect;
  26. bool m_bIsConnected;
  27. bool m_connectOnStartup;
  28. CString m_activeWindow;
  29. CString m_activeWindowTitle;
  30. // m_pHandler->OnClipboardChange is called when the clipboard changes.
  31. CCopyThread* m_pHandler;
  32. void Connect(); // connects as a clipboard viewer
  33. void Disconnect(bool bSendPing = true); // disconnects as a clipboard viewer
  34. void SendPing();
  35. bool GetConnect() { return m_bConnect; }
  36. void SetConnect(bool bConnect);
  37. void SetEnsureConnectedTimer();
  38. bool ValidActiveWnd();
  39. DWORD m_dwLastCopy;
  40. // Generated message map functions
  41. protected:
  42. //{{AFX_MSG(CClipboardViewer)
  43. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  44. afx_msg void OnDestroy();
  45. afx_msg void OnChangeCbChain(HWND hWndRemove, HWND hWndAfter);
  46. afx_msg void OnDrawClipboard();
  47. afx_msg void OnTimer(UINT_PTR nIDEvent);
  48. //}}AFX_MSG
  49. afx_msg LRESULT OnSetConnect(WPARAM wParam, LPARAM lParam);
  50. afx_msg LRESULT CClipboardViewer::OnClipboardChange(WPARAM wParam, LPARAM lPara);
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. /////////////////////////////////////////////////////////////////////////////
  54. //{{AFX_INSERT_LOCATION}}
  55. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  56. #endif // !defined(AFX_CLIPBOARDVIEWER_H__67418FB6_6048_48FA_86D4_F412CACC41B1__INCLUDED_)