ClipboardViewer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // m_pHandler->OnClipboardChange is called when the clipboard changes.
  28. CCopyThread* m_pHandler;
  29. void Connect(); // connects as a clipboard viewer
  30. void Disconnect(bool bSendPing = true); // disconnects as a clipboard viewer
  31. void SendPing();
  32. bool GetConnect() { return m_bConnect; }
  33. void SetConnect(bool bConnect);
  34. void SetEnsureConnectedTimer();
  35. DWORD m_dwLastCopy;
  36. bool m_bHandlingClipChange;
  37. // Generated message map functions
  38. protected:
  39. //{{AFX_MSG(CClipboardViewer)
  40. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  41. afx_msg void OnDestroy();
  42. afx_msg void OnChangeCbChain(HWND hWndRemove, HWND hWndAfter);
  43. afx_msg void OnDrawClipboard();
  44. afx_msg void OnTimer(UINT nIDEvent);
  45. //}}AFX_MSG
  46. afx_msg LRESULT OnSetConnect(WPARAM wParam, LPARAM lParam);
  47. DECLARE_MESSAGE_MAP()
  48. };
  49. /////////////////////////////////////////////////////////////////////////////
  50. //{{AFX_INSERT_LOCATION}}
  51. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  52. #endif // !defined(AFX_CLIPBOARDVIEWER_H__67418FB6_6048_48FA_86D4_F412CACC41B1__INCLUDED_)