ClipboardViewer.h 1.9 KB

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