DittoCopyBuffer.h 914 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "ClipboardSaveRestore.h"
  3. #include "afxmt.h"
  4. class CClipboardSaveRestoreCopyBuffer : public CClipboardSaveRestore
  5. {
  6. public:
  7. CClipboardSaveRestoreCopyBuffer()
  8. {
  9. m_lRestoreDelay = 0;
  10. }
  11. long m_lRestoreDelay;
  12. };
  13. class CDittoCopyBuffer
  14. {
  15. public:
  16. CDittoCopyBuffer();
  17. ~CDittoCopyBuffer(void);
  18. bool Active() { return m_bActive; }
  19. bool StartCopy(long lCopyBuffer, bool bCut = false);
  20. bool EndCopy(long lID);
  21. bool PastCopyBuffer(long lCopyBuffer);
  22. static bool PutClipOnDittoCopyBuffer(long lClipId, long lBuffer);
  23. static UINT DelayRestoreClipboard(LPVOID pParam);
  24. static UINT StartCopyTimer(LPVOID pParam);
  25. protected:
  26. void EndRestoreThread();
  27. protected:
  28. long m_lCurrentDittoBuffer;
  29. CClipboardSaveRestore m_SavedClipboard;
  30. bool m_bActive;
  31. DWORD m_dwLastPaste;
  32. CEvent m_ActiveTimer;
  33. CEvent m_RestoreTimer;
  34. CEvent m_Pasting;
  35. CClipboardSaveRestoreCopyBuffer *m_pClipboard;
  36. };