Browse Source

copy buffers

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@369 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 19 years ago
parent
commit
a003b5916e
17 changed files with 586 additions and 114 deletions
  1. 78 60
      CP_Main.cpp
  2. 11 6
      CP_Main.h
  3. 74 4
      CP_Main.rc
  4. 11 2
      CP_Main.vcproj
  5. 2 0
      Clip.cpp
  6. 2 1
      ClipboardSaveRestore.cpp
  7. 105 15
      DittoCopyBuffer.cpp
  8. 19 3
      DittoCopyBuffer.h
  9. 48 17
      MainFrm.cpp
  10. 16 0
      Options.cpp
  11. 20 0
      Options.h
  12. 117 0
      OptionsCopyBuffers.cpp
  13. 37 0
      OptionsCopyBuffers.h
  14. 5 0
      OptionsSheet.cpp
  15. 1 0
      OptionsSheet.h
  16. 4 4
      ProcessPaste.cpp
  17. 36 2
      Resource.h

+ 78 - 60
CP_Main.cpp

@@ -15,6 +15,7 @@
 #include "Clip_ImportExport.h"
 #include "HyperLink.h"
 #include "OptionsSheet.h"
+#include "DittoCopyBuffer.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -37,33 +38,34 @@ public:
 		m_bU3Install = FALSE;
 	}
 
-	virtual void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast)
-	{
-		if(bFlag)
-		{
-			if(STRICMP(pszParam, _T("Connect")) == 0)
-			{
-				m_bConnect = TRUE;
-			}
-			else if(STRICMP(pszParam, _T("Disconnect")) == 0)
-			{
-				m_bDisconnect = TRUE;
-			}
-			else if(STRICMP(pszParam, _T("U3")) == 0)
-			{
-				m_bU3 = TRUE;
-			}
-			else if(STRICMP(pszParam, _T("U3appStop")) == 0)
-			{
-				m_bU3Stop = TRUE;
-			}
-			else if(STRICMP(pszParam, _T("U3Install")) == 0)
-			{
-				m_bU3Install = TRUE;
-			}
-		}
-
-	}
+ 	virtual void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast)
+ 	{
+  		if(bFlag)
+  		{
+  			if(STRICMP(pszParam, _T("Connect")) == 0)
+  			{
+  				m_bConnect = TRUE;
+  			}
+  			else if(STRICMP(pszParam, _T("Disconnect")) == 0)
+  			{
+  				m_bDisconnect = TRUE;
+  			}
+  			else if(STRICMP(pszParam, _T("U3")) == 0)
+  			{
+  				m_bU3 = TRUE;
+  			}
+  			else if(STRICMP(pszParam, _T("U3appStop")) == 0)
+  			{
+  				m_bU3Stop = TRUE;
+  			}
+  			else if(STRICMP(pszParam, _T("U3Install")) == 0)
+  			{
+  				m_bU3Install = TRUE;
+  			}
+  		}
+ 
+		CCommandLineInfo::ParseParam(pszParam, bFlag, bLast);
+ 	}
 
 	BOOL m_bDisconnect;
 	BOOL m_bConnect;
@@ -126,8 +128,6 @@ CCP_MainApp::CCP_MainApp()
 	m_QuickPasteMode = NONE_QUICK_PASTE;
 	m_pQuickPasteClip = NULL;
 	m_bDittoHasFocus = false;
-
-	m_pDittoCopyBuffer = NULL;
 }
 
 CCP_MainApp::~CCP_MainApp()
@@ -150,6 +150,8 @@ BOOL CCP_MainApp::InitInstance()
 	{
 		try
 		{
+			g_Opt.m_bEnableDebugLogging = g_Opt.GetEnableDebugLogging();
+
 			CClip_ImportExport Clip;
 			CppSQLite3DB db;
 			db.open(cmdInfo.m_strFileName);
@@ -293,6 +295,15 @@ void CCP_MainApp::AfterMainCreate()
 	m_pPosEight = new CHotKey("Position8", 0, true);
 	m_pPosNine = new CHotKey("Position9", 0, true);
 	m_pPosTen = new CHotKey("Position10", 0, true);
+	m_pCopyBuffer1 = new CHotKey("CopyBufferCopyHotKey_0", 0, true);
+	m_pPasteBuffer1 = new CHotKey("CopyBufferPasteHotKey_0", 0, true);
+	m_pCutBuffer1 = new CHotKey("CopyBufferCutHotKey_0", 0, true);
+	m_pCopyBuffer2 = new CHotKey("CopyBufferCopyHotKey_1", 0, true);
+	m_pPasteBuffer2 = new CHotKey("CopyBufferPasteHotKey_1", 0, true);
+	m_pCutBuffer2 = new CHotKey("CopyBufferCutHotKey_1", 0, true);
+	m_pCopyBuffer3 = new CHotKey("CopyBufferCopyHotKey_2", 0, true);
+	m_pPasteBuffer3 = new CHotKey("CopyBufferPasteHotKey_2", 0, true);
+	m_pCutBuffer3 = new CHotKey("CopyBufferPasteHotKey_2", 0, true);
 
 	g_HotKeys.RegisterAll();
 
@@ -411,8 +422,6 @@ bool CCP_MainApp::ReleaseFocus()
 // sends Ctrl-V to the TargetWnd
 void CCP_MainApp::SendPaste(bool bActivateTarget)
 {
-	Log(_T("SendPaste"));
-
 	char ch;
 
 	//Make sure all the keys are up
@@ -453,8 +462,6 @@ void CCP_MainApp::SendPaste(bool bActivateTarget)
 	keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
 
 	PumpMessageEx();
-
-	Log(_T("END SendPaste"));
 }
 
 // sends Ctrl-V to the TargetWnd
@@ -479,12 +486,7 @@ void CCP_MainApp::SendCopy()
 	
 	Sleep(50);
 
-	MSG KeyboardMsg;
-	while (::PeekMessage(&KeyboardMsg, NULL, 0, 0, PM_REMOVE))
-	{
-		::TranslateMessage(&KeyboardMsg);
-		::DispatchMessage(&KeyboardMsg);
-    }
+	PumpMessageEx();
 
 	Sleep(50);
 
@@ -497,6 +499,41 @@ void CCP_MainApp::SendCopy()
 	keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
 }
 
+// sends Ctrl-X to the TargetWnd
+void CCP_MainApp::SendCut()
+{
+	char ch;
+
+	//Make sure all the keys are up
+	for(ch = '0'; ch <= '9'; ch++)
+	{
+		keybd_event(ch, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	}
+
+	for(ch = 'A'; ch <= 'Z'; ch++)
+	{
+		keybd_event(ch, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	}
+	keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	keybd_event(VK_MENU, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+
+	Sleep(50);
+
+	PumpMessageEx();
+
+	Sleep(50);
+
+	keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY | 0, 0);
+	keybd_event('X', 0, KEYEVENTF_EXTENDEDKEY | 0, 0);
+
+	Sleep(50);
+
+	keybd_event('X', 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+}
+
 // CopyThread
 
 void CCP_MainApp::StartCopyThread()
@@ -629,12 +666,10 @@ long CCP_MainApp::SaveCopyClips()
 		//go ahead and send the clips out even though it won't be added for a bit
 		count = 1;
 	}
-	else if(m_QuickPasteMode == DITTO_BUFFER_QUICK_PASTE && m_pDittoCopyBuffer != NULL)
+	else if(CDittoCopyBuffer::GetDittoCopyBuffer()->Active())
 	{
-		m_pDittoCopyBuffer->EndCopy(pClips);
+		CDittoCopyBuffer::GetDittoCopyBuffer()->EndCopy(pClips);
 		
-		ClearDittoCopyBuffer();
-
 		//go ahead and send the clips out even though it won't be added for a bit
 		count = 1;
 	}
@@ -1095,23 +1130,6 @@ int CCP_MainApp::ShowOptionsDlg()
 	return nRet;
 }
 
-void CCP_MainApp::CreateDittoCopyBuffer(long lCopyBuffer)
-{
-	m_pDittoCopyBuffer = new CDittoCopyBuffer();
-	if(m_pDittoCopyBuffer)
-	{
-		m_pDittoCopyBuffer->StartCopy(lCopyBuffer);
-	}
-}
-
-void CCP_MainApp::ClearDittoCopyBuffer()
-{
-	delete m_pDittoCopyBuffer;
-	m_pDittoCopyBuffer = NULL;
-
-	theApp.m_QuickPasteMode = CCP_MainApp::NONE_QUICK_PASTE;
-}
-
 void CCP_MainApp::PumpMessageEx()
 {
 	MSG KeyboardMsg;

+ 11 - 6
CP_Main.h

@@ -23,7 +23,6 @@
 #include "MultiLanguage.h"
 #include "CopyThread.h"
 #include "ClipboardSaveRestore.h"
-#include "DittoCopyBuffer.h"
 
 #include "sqlite\CppSQLite3.h"
 
@@ -71,6 +70,16 @@ public:
 	CHotKey*	m_pPosNine;
 	CHotKey*	m_pPosTen;
 
+	CHotKey		*m_pCopyBuffer1;
+	CHotKey		*m_pPasteBuffer1;
+	CHotKey		*m_pCutBuffer1;
+	CHotKey		*m_pCopyBuffer2;
+	CHotKey		*m_pPasteBuffer2;
+	CHotKey		*m_pCutBuffer2;
+	CHotKey		*m_pCopyBuffer3;
+	CHotKey		*m_pPasteBuffer3;
+	CHotKey		*m_pCutBuffer3;
+
 // Focus Tracking
 	HWND m_hTargetWnd;
 	bool TargetActiveWindow();
@@ -79,6 +88,7 @@ public:
 	CString GetTargetName();
 	void SendPaste(bool bActivateTarget); // Activates the Target and sends Ctrl-V
 	void SendCopy();
+	void SendCut();
 
 // CopyThread and ClipViewer (Copy and Paste Management)
 	CCopyThread	m_CopyThread;
@@ -174,17 +184,12 @@ public:
 
 	eQuickPasteMode m_QuickPasteMode;
 	CClipList* m_pQuickPasteClip;
-
-	void CreateDittoCopyBuffer(long lCopyBuffer);
-	void ClearDittoCopyBuffer();
 	
 	bool m_bDittoHasFocus;
 
 	void PumpMessageEx();
 
 protected:
-	CDittoCopyBuffer *m_pDittoCopyBuffer;
-
 // Overrides
 	// ClassWizard generated virtual function overrides
 	//{{AFX_VIRTUAL(CCP_MainApp)

+ 74 - 4
CP_Main.rc

@@ -841,6 +841,68 @@ BEGIN
                     ACS_TRANSPARENT | WS_TABSTOP,7,4,270,26
 END
 
+IDD_OPTIONS_COPY_BUFFERS DIALOGEX 0, 0, 287, 250
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
+    WS_SYSMENU
+CAPTION "Copy Buffers"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    CONTROL         "",IDC_COPY_1,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,16,80,14
+    CONTROL         "Win",IDC_WIN_COPY_1,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,16,33,14
+    CONTROL         "",IDC_PASTE_1,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,32,80,14
+    CONTROL         "Win",IDC_WIN_PASTE_1,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,32,33,14
+    LTEXT           "Copy",IDC_STATIC_COPY_1,19,16,42,14,SS_CENTERIMAGE
+    LTEXT           "Paste",IDC_STATIC_PASTE_1,19,32,43,14,SS_CENTERIMAGE
+    CONTROL         "",IDC_CUT_1,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,63,
+                    47,80,14
+    CONTROL         "Win",IDC_WIN_CUT_1,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,47,33,14
+    LTEXT           "Cut",IDC_STATIC_CUT_1,19,47,43,14,SS_CENTERIMAGE
+    GROUPBOX        "Copy Buffer 1",IDC_BUFFER_GROUP_1,7,7,273,61
+    CONTROL         "Play Sound on Copy",IDC_PLAY_SOUND_1,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,179,16,80,14
+    CONTROL         "",IDC_COPY_2,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,81,80,14
+    CONTROL         "Win",IDC_WIN_COPY_2,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,81,33,14
+    CONTROL         "",IDC_PASTE_2,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,97,80,14
+    CONTROL         "Win",IDC_WIN_PASTE_2,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,97,33,14
+    LTEXT           "Copy",IDC_STATIC_COPY_2,19,81,42,14,SS_CENTERIMAGE
+    LTEXT           "Paste",IDC_STATIC_PASTE_2,19,97,43,14,SS_CENTERIMAGE
+    CONTROL         "",IDC_CUT_2,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,63,
+                    112,80,14
+    CONTROL         "Win",IDC_WIN_CUT_2,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,112,33,14
+    LTEXT           "Cut",IDC_STATIC_CUT_2,19,112,43,14,SS_CENTERIMAGE
+    GROUPBOX        "Copy Buffer 2",IDC_BUFFER_GROUP_2,7,72,273,61
+    CONTROL         "Play Sound on Copy",IDC_PLAY_SOUND_2,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,179,81,80,14
+    CONTROL         "",IDC_COPY_3,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,148,80,14
+    CONTROL         "Win",IDC_WIN_COPY_3,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,148,33,14
+    CONTROL         "",IDC_PASTE_3,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,
+                    63,164,80,14
+    CONTROL         "Win",IDC_WIN_PASTE_3,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,164,33,14
+    LTEXT           "Copy",IDC_STATIC_COPY_3,19,148,42,14,SS_CENTERIMAGE
+    LTEXT           "Paste",IDC_STATIC_PASTE_3,19,164,43,14,SS_CENTERIMAGE
+    CONTROL         "",IDC_CUT_3,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,63,
+                    179,80,14
+    CONTROL         "Win",IDC_WIN_CUT_3,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,179,33,14
+    LTEXT           "Cut",IDC_STATIC_CUT_3,19,179,43,14,SS_CENTERIMAGE
+    GROUPBOX        "Copy Buffer 3",IDC_BUFFER_GROUP_3,7,139,273,61
+    CONTROL         "Play Sound on Copy",IDC_PLAY_SOUND_3,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,179,148,80,14
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -848,8 +910,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,11,0,0
- PRODUCTVERSION 3,11,0,0
+ FILEVERSION 3,12,0,0
+ PRODUCTVERSION 3,12,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -865,12 +927,12 @@ BEGIN
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "Ditto"
-            VALUE "FileVersion", "3, 11, 0, 0"
+            VALUE "FileVersion", "3, 12, 0, 0"
             VALUE "InternalName", "CP_Main"
             VALUE "LegalCopyright", "Copyright (C) 2003"
             VALUE "OriginalFilename", "Ditto"
             VALUE "ProductName", "Ditto"
-            VALUE "ProductVersion", "3, 11, 0, 0"
+            VALUE "ProductVersion", "3, 12, 0, 0"
         END
     END
     BLOCK "VarFileInfo"
@@ -1007,6 +1069,14 @@ BEGIN
         TOPMARGIN, 7
         BOTTOMMARGIN, 103
     END
+
+    IDD_OPTIONS_COPY_BUFFERS, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 280
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 243
+    END
 END
 #endif    // APSTUDIO_INVOKED
 

+ 11 - 2
CP_Main.vcproj

@@ -1389,6 +1389,9 @@
 						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
+			<File
+				RelativePath=".\OptionsCopyBuffers.cpp">
+			</File>
 			<File
 				RelativePath="OptionsGeneral.cpp">
 				<FileConfiguration
@@ -2723,6 +2726,9 @@
 			<File
 				RelativePath="Options.h">
 			</File>
+			<File
+				RelativePath=".\OptionsCopyBuffers.h">
+			</File>
 			<File
 				RelativePath="OptionsGeneral.h">
 			</File>
@@ -2802,6 +2808,9 @@
 			<File
 				RelativePath="res\bitmap1.bmp">
 			</File>
+			<File
+				RelativePath=".\res\bitmap2.bmp">
+			</File>
 			<File
 				RelativePath="res\bmp00001.bmp">
 			</File>
@@ -2927,7 +2936,7 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="Release\focus.dll">
+				RelativePath="Debug\focus.dll">
 				<FileConfiguration
 					Name="Release|Win32"
 					ExcludedFromBuild="TRUE">
@@ -2954,7 +2963,7 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="Debug\focus.dll">
+				RelativePath="Release\focus.dll">
 				<FileConfiguration
 					Name="Release|Win32"
 					ExcludedFromBuild="TRUE">

+ 2 - 0
Clip.cpp

@@ -504,6 +504,8 @@ bool CClip::AddToDB(bool bCheckForDuplicates)
 				
 				EmptyFormats();
 
+				m_ID = nID;
+
 				return true;
 			}
 		}

+ 2 - 1
ClipboardSaveRestore.cpp

@@ -20,7 +20,8 @@ bool CClipboardSaveRestore::Save()
 	//Attach to the clipboard
 	if(!oleData.AttachClipboard())
 	{
-		ASSERT(0);
+		ASSERT(FALSE);
+		Log(_T("CClipboardSaveRestore::Save error opening clipboard"));
 		return bRet;
 	}
 

+ 105 - 15
DittoCopyBuffer.cpp

@@ -1,9 +1,17 @@
 #include "stdafx.h"
 #include ".\dittocopybuffer.h"
 #include "CP_Main.h"
+#include <Mmsystem.h> //play sound
+
+CEvent CDittoCopyBuffer::m_ActiveTimer(TRUE, TRUE);
+CEvent CDittoCopyBuffer::m_RestoreTimer(TRUE, TRUE);
+CEvent CDittoCopyBuffer::m_RestoreActive(TRUE, TRUE);
+CDittoCopyBuffer CDittoCopyBuffer::m_Singleton;
 
 CDittoCopyBuffer::CDittoCopyBuffer()
 {
+	m_bActive = false;
+	m_dwLastPaste = 0;
 }
 
 CDittoCopyBuffer::~CDittoCopyBuffer(void)
@@ -11,15 +19,47 @@ CDittoCopyBuffer::~CDittoCopyBuffer(void)
 }
 
 
-bool CDittoCopyBuffer::StartCopy(long lCopyBuffer)
+bool CDittoCopyBuffer::StartCopy(long lCopyBuffer, bool bCut)
 {
+	Log(StrF(_T("Start of Ditto Copy buffer = %d"), lCopyBuffer));
+
+	m_ActiveTimer.SetEvent();
+	EndRestoreThread();
+
+	m_bActive = true;
 	m_lCurrentDittoBuffer = lCopyBuffer;
 	m_SavedClipboard.Save();
-	theApp.SendCopy();
+	if(bCut)
+	{
+		theApp.SendCut();
+	}
+	else
+	{
+		theApp.SendCopy();
+	}
+
+	AfxBeginThread(CDittoCopyBuffer::StartCopyTimer, (LPVOID)this, THREAD_PRIORITY_LOWEST);
 
 	return true;
 }
 
+UINT CDittoCopyBuffer::StartCopyTimer(LPVOID pParam)
+{
+	m_ActiveTimer.ResetEvent();
+
+	CDittoCopyBuffer *pBuffer = (CDittoCopyBuffer*)pParam;
+	if(pBuffer)
+	{
+		DWORD dRes = WaitForSingleObject(m_ActiveTimer, 1500);
+		if(dRes == WAIT_TIMEOUT)
+		{
+			pBuffer->m_bActive = false;
+		}
+	}
+
+	return 0;
+}
+
 bool CDittoCopyBuffer::EndCopy(CClipList *pClips)
 {
 	if(m_lCurrentDittoBuffer < 0 || m_lCurrentDittoBuffer >= 10)
@@ -28,12 +68,17 @@ bool CDittoCopyBuffer::EndCopy(CClipList *pClips)
 		return false;
 	}
 
-	m_SavedClipboard.Restore();
+	m_ActiveTimer.SetEvent();
+	m_bActive = false;
+
+	Log(StrF(_T("Start - Ditto EndCopy buffer = %d"), m_lCurrentDittoBuffer));
 
 	bool bRet = false;
 
 	if(pClips)
 	{
+		m_SavedClipboard.Restore();
+
 		try
 		{	
 			CClip *pClip = pClips->GetHead();
@@ -57,6 +102,10 @@ bool CDittoCopyBuffer::EndCopy(CClipList *pClips)
 					theApp.m_db.execDMLEx(_T("UPDATE CopyBuffers SET lClipID = %d WHERE lCopyBuffer = %d"), lID, m_lCurrentDittoBuffer);
 
 					bRet = true;
+					
+					Log(StrF(_T("Ditto end copy, saved clip successfully Clip ID = %d"), lID));
+
+					PlaySound(_T("ding.wav"), NULL, SND_FILENAME|SND_ASYNC);
 				}
 				else
 				{
@@ -84,8 +133,17 @@ bool CDittoCopyBuffer::EndCopy(CClipList *pClips)
 
 bool CDittoCopyBuffer::PastCopyBuffer(long lCopyBuffer)
 {
+	DWORD dNow = GetTickCount();
+	if(((dNow - m_dwLastPaste) < 500) || (dNow < m_dwLastPaste))
+	{
+		Log(_T("Copy Buffer pasted to fast"));
+		return false;
+	}
+	m_dwLastPaste = GetTickCount();
 	bool bRet = false;
 
+	Log(StrF(_T("Start - PastCopyBuffer buffer = %d"), m_lCurrentDittoBuffer));
+
 	try
 	{
 		CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT Main.lID FROM Main ")
@@ -97,19 +155,28 @@ bool CDittoCopyBuffer::PastCopyBuffer(long lCopyBuffer)
 			CClipboardSaveRestoreCopyBuffer *pClipboard = new CClipboardSaveRestoreCopyBuffer;
 			if(pClipboard)
 			{
-				pClipboard->Save();
+				EndRestoreThread();
 
-				CProcessPaste paste;
-				paste.m_bSendPaste = true;
-				paste.m_bActivateTarget = false;
-				paste.GetClipIDs().Add(q.getIntField(_T("lID")));
-				paste.DoPaste();
+				if(pClipboard->Save())
+				{
+					CProcessPaste paste;
+					paste.m_bSendPaste = true;
+					paste.m_bActivateTarget = false;
+					paste.GetClipIDs().Add(q.getIntField(_T("lID")));
+					paste.DoPaste();
+
+					pClipboard->m_lRestoreDelay = g_Opt.GetDittoRestoreClipboardDelay();
 
-				pClipboard->m_lRestoreDelay = g_Opt.GetDittoRestoreClipboardDelay();
+					Log(StrF(_T("PastCopyBuffer sent paste, starting thread to restore clipboard, Delay = %d"), pClipboard->m_lRestoreDelay));
 
-				AfxBeginThread(CDittoCopyBuffer::DelayRestoreClipboard, (LPVOID)pClipboard, THREAD_PRIORITY_LOWEST);
+					AfxBeginThread(CDittoCopyBuffer::DelayRestoreClipboard, (LPVOID)pClipboard, THREAD_PRIORITY_LOWEST);
 
-				bRet = true;
+					bRet = true;
+				}
+				else
+				{
+					Log(_T("PastCopyBuffer failed to save clipboard"));
+				}
 			}
 		}
 	}
@@ -118,15 +185,38 @@ bool CDittoCopyBuffer::PastCopyBuffer(long lCopyBuffer)
 	return bRet;
 }
 
+void CDittoCopyBuffer::EndRestoreThread()
+{
+	//Tell the thread to stop waiting and restore the clipboard
+	m_RestoreTimer.SetEvent();
+	//make sure it's ended
+	WaitForSingleObject(m_RestoreActive, 5000);
+}
+
 UINT CDittoCopyBuffer::DelayRestoreClipboard(LPVOID pParam)
 {
-	CClipboardSaveRestoreCopyBuffer *pClipboard = (CClipboardSaveRestoreCopyBuffer*)pParam;
+	m_RestoreTimer.ResetEvent();
+	m_RestoreActive.ResetEvent();
 
+	CClipboardSaveRestoreCopyBuffer *pClipboard = (CClipboardSaveRestoreCopyBuffer*)pParam;
 	if(pClipboard)
 	{
-		Sleep(pClipboard->m_lRestoreDelay);
-		pClipboard->Restore();
+		DWORD dRes = WaitForSingleObject(m_RestoreTimer, pClipboard->m_lRestoreDelay);
+
+		if(GetKeyState(VK_SHIFT) & 0x8000)
+		{
+			Log(_T("Shift key is down not restoring clipbard, custom Buffer on normal clipboard"));
+		}
+		else
+		{
+			pClipboard->Restore();
+		}
+
+		delete pClipboard;
+		pClipboard = NULL;
 	}
 
+	m_RestoreActive.SetEvent();
+
 	return TRUE;
 }

+ 19 - 3
DittoCopyBuffer.h

@@ -1,6 +1,7 @@
 #pragma once
 
 #include "ClipboardSaveRestore.h"
+#include "afxmt.h"
 
 class CClipboardSaveRestoreCopyBuffer : public CClipboardSaveRestore
 {
@@ -15,16 +16,31 @@ public:
 class CDittoCopyBuffer
 {
 public:
-	CDittoCopyBuffer();
 	~CDittoCopyBuffer(void);
 
-	bool StartCopy(long lCopyBuffer);
-	bool EndCopy(CClipList *pClips);
+	static CDittoCopyBuffer *GetDittoCopyBuffer()	{ return &m_Singleton; }
 
+	bool Active()	{ return m_bActive; }
+	bool StartCopy(long lCopyBuffer, bool bCut = false);
+	bool EndCopy(CClipList *pClips);
 	bool PastCopyBuffer(long lCopyBuffer);
+
 	static UINT DelayRestoreClipboard(LPVOID pParam);
+	static UINT StartCopyTimer(LPVOID pParam);
+
+protected:
+	void EndRestoreThread();
+
+protected:
+	CDittoCopyBuffer();
+	static CDittoCopyBuffer m_Singleton;
 
 protected:
 	long m_lCurrentDittoBuffer;
 	CClipboardSaveRestore m_SavedClipboard;
+	bool m_bActive;
+	DWORD m_dwLastPaste;
+	static CEvent m_ActiveTimer;
+	static CEvent m_RestoreTimer;
+	static CEvent m_RestoreActive;
 };

+ 48 - 17
MainFrm.cpp

@@ -249,23 +249,23 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
 			QuickPaste.ShowQPasteWnd(this, false, true, FALSE);
 		}		
 	}
-	else if(!g_Opt.m_bU3 && wParam == theApp.m_pNamedCopy->m_Atom)
+	else if(wParam == theApp.m_pNamedCopy->m_Atom)
 	{
-		if(theApp.m_QuickPasteMode == CCP_MainApp::NONE_QUICK_PASTE)
+		if(g_Opt.m_bU3 == false)
 		{
-			theApp.m_QuickPasteMode = CCP_MainApp::DITTO_BUFFER_QUICK_PASTE;
-			
-			theApp.CreateDittoCopyBuffer(1);
-
-			SetTimer(END_DITTO_BUFFER_CLIPBOARD_TIMER, 2000, NULL);
+			if(theApp.m_QuickPasteMode == CCP_MainApp::NONE_QUICK_PASTE)
+			{
+				
+			}
 		}
 	}
-	else if(!g_Opt.m_bU3 && wParam == theApp.m_pNamedPaste->m_Atom)
+	else if(wParam == theApp.m_pNamedPaste->m_Atom)
 	{
-		if(theApp.m_QuickPasteMode == CCP_MainApp::NONE_QUICK_PASTE)
+		if(g_Opt.m_bU3 == false)
 		{
-			CDittoCopyBuffer Past;
-			Past.PastCopyBuffer(1);
+			if(theApp.m_QuickPasteMode == CCP_MainApp::NONE_QUICK_PASTE)
+			{
+			}
 		}
 	}
 	else if(wParam == theApp.m_pPosOne->m_Atom)
@@ -279,7 +279,7 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
 	else if(wParam == theApp.m_pPosThree->m_Atom)
 	{
 		DoFirstTenPositionsPaste(2);
-	}	
+	}
 	else if(wParam == theApp.m_pPosFour->m_Atom)
 	{
 		DoFirstTenPositionsPaste(3);
@@ -308,6 +308,42 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
 	{
 		DoFirstTenPositionsPaste(9);
 	}
+	else if(wParam == theApp.m_pCopyBuffer1->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(1);
+	}
+	else if(wParam == theApp.m_pPasteBuffer1->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->PastCopyBuffer(1);
+	}
+	else if(wParam == theApp.m_pCutBuffer1->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(1, true);
+	}
+	else if(wParam == theApp.m_pCopyBuffer2->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(2);
+	}
+	else if(wParam == theApp.m_pPasteBuffer2->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->PastCopyBuffer(2);
+	}
+	else if(wParam == theApp.m_pCutBuffer2->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(2, true);
+	}
+	else if(wParam == theApp.m_pCopyBuffer3->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(3);
+	}
+	else if(wParam == theApp.m_pPasteBuffer3->m_Atom)
+	{	
+		CDittoCopyBuffer::GetDittoCopyBuffer()->PastCopyBuffer(3);
+	}
+	else if(wParam == theApp.m_pCutBuffer3->m_Atom)
+	{
+		CDittoCopyBuffer::GetDittoCopyBuffer()->StartCopy(3, true);
+	}
 
 	return TRUE;
 }
@@ -445,11 +481,6 @@ void CMainFrame::OnTimer(UINT nIDEvent)
 	case REMOVE_OLD_REMOTE_COPIES:
 		AfxBeginThread(CMainFrame::RemoteOldRemoteFilesThread, NULL);
 		break;
-
-	case END_DITTO_BUFFER_CLIPBOARD_TIMER:
-		KillTimer(END_DITTO_BUFFER_CLIPBOARD_TIMER);
-		theApp.ClearDittoCopyBuffer();
-		break;
 	}
 
 	CFrameWnd::OnTimer(nIDEvent);

+ 16 - 0
Options.cpp

@@ -1635,4 +1635,20 @@ long CGetSetOptions::GetDittoRestoreClipboardDelay()
 void CGetSetOptions::SetDittoRestoreClipboardDelay(long lDelay)
 {
 	SetProfileLong("RestoreClipboardDelay", lDelay);
+}
+
+void CGetSetOptions::GetCopyBufferItem(int nPos, CCopyBufferItem &Item)
+{
+	Item.m_lCopyHotKey = GetProfileLong(StrF(_T("CopyBufferCopyHotKey_%d"), nPos), 0);
+	Item.m_lPasteHotKey = GetProfileLong(StrF(_T("CopyBufferPasteHotKey_%d"), nPos), 0);
+	Item.m_lCutHotKey = GetProfileLong(StrF(_T("CopyBufferCutHotKey_%d"), nPos), 0);
+	Item.m_bPlaySoundOnCopy = GetProfileLong(StrF(_T("CopyBufferPlaySound_%d"), nPos), 0);
+}
+
+void CGetSetOptions::SetCopyBufferItem(int nPos, CCopyBufferItem &Item)
+{
+	SetProfileLong(StrF(_T("CopyBufferCopyHotKey_%d"), nPos), Item.m_lCopyHotKey);
+	GetProfileLong(StrF(_T("CopyBufferPasteHotKey_%d"), nPos), Item.m_lPasteHotKey);
+	GetProfileLong(StrF(_T("CopyBufferCutHotKey_%d"), nPos), Item.m_lCutHotKey);
+	GetProfileLong(StrF(_T("CopyBufferPlaySound_%d"), nPos), Item.m_bPlaySoundOnCopy);
 }

+ 20 - 0
Options.h

@@ -15,6 +15,23 @@ public:
 	BOOL bShownFirstError;
 };
 
+#define MAX_COPY_BUFFER	3
+class CCopyBufferItem
+{
+public:
+	CCopyBufferItem()
+	{
+		m_lCopyHotKey = -1;
+		m_lPasteHotKey = -1;
+		m_lCutHotKey = -1;
+		m_bPlaySoundOnCopy = FALSE;
+	}
+	long m_lCopyHotKey;
+	long m_lPasteHotKey;
+	long m_lCutHotKey;
+	BOOL m_bPlaySoundOnCopy;
+};
+
 #define REG_PATH					"Software\\Ditto"
 
 #define POS_AT_CARET	1
@@ -326,6 +343,9 @@ public:
 
 	static long		GetDittoRestoreClipboardDelay();
 	static void		SetDittoRestoreClipboardDelay(long lDelay);
+
+	static void		GetCopyBufferItem(int nPos, CCopyBufferItem &Item);
+	static void		SetCopyBufferItem(int nPos, CCopyBufferItem &Item);
 };
 
 // global for easy access and for initialization of fast access variables

+ 117 - 0
OptionsCopyBuffers.cpp

@@ -0,0 +1,117 @@
+// OptionsCopyBuffers.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "CP_Main.h"
+#include "OptionsCopyBuffers.h"
+
+
+// COptionsCopyBuffers dialog
+
+IMPLEMENT_DYNCREATE(COptionsCopyBuffers, CPropertyPage)
+
+COptionsCopyBuffers::COptionsCopyBuffers() : CPropertyPage(COptionsCopyBuffers::IDD)
+{
+}
+
+COptionsCopyBuffers::~COptionsCopyBuffers()
+{
+}
+
+void COptionsCopyBuffers::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	DDX_Control(pDX, IDC_COPY_1, m_CopyBuffer1);
+	DDX_Control(pDX, IDC_PASTE_1, m_PasteBuffer1);
+	DDX_Control(pDX, IDC_CUT_1, m_CutBuffer1);
+	DDX_Control(pDX, IDC_COPY_2, m_CopyBuffer2);
+	DDX_Control(pDX, IDC_PASTE_2, m_PasteBuffer2);
+	DDX_Control(pDX, IDC_CUT_2, m_CutBuffer2);
+	DDX_Control(pDX, IDC_COPY_3, m_CopyBuffer3);
+	DDX_Control(pDX, IDC_PASTE_3, m_PasteBuffer3);
+	DDX_Control(pDX, IDC_CUT_3, m_CutBuffer3);
+}
+
+
+BEGIN_MESSAGE_MAP(COptionsCopyBuffers, CPropertyPage)
+END_MESSAGE_MAP()
+
+BOOL COptionsCopyBuffers::OnInitDialog()
+{
+	CPropertyPage::OnInitDialog();
+
+	CCopyBufferItem Item;
+	
+	g_Opt.GetCopyBufferItem(0, Item);
+	theApp.m_pCopyBuffer1->CopyToCtrl(m_CopyBuffer1, m_hWnd, IDC_WIN_COPY_1);
+	theApp.m_pPasteBuffer1->CopyToCtrl(m_PasteBuffer1, m_hWnd, IDC_WIN_PASTE_1);
+	theApp.m_pCutBuffer1->CopyToCtrl(m_CutBuffer1, m_hWnd, IDC_WIN_CUT_1);
+	CheckDlgButton(IDC_PLAY_SOUND_1, Item.m_bPlaySoundOnCopy);
+
+	g_Opt.GetCopyBufferItem(1, Item);
+	theApp.m_pCopyBuffer2->CopyToCtrl(m_CopyBuffer2, m_hWnd, IDC_WIN_COPY_2);
+	theApp.m_pPasteBuffer2->CopyToCtrl(m_PasteBuffer2, m_hWnd, IDC_WIN_PASTE_2);
+	theApp.m_pCutBuffer2->CopyToCtrl(m_CutBuffer2, m_hWnd, IDC_WIN_CUT_2);
+	CheckDlgButton(IDC_PLAY_SOUND_2, Item.m_bPlaySoundOnCopy);
+
+	g_Opt.GetCopyBufferItem(2, Item);
+	theApp.m_pCopyBuffer3->CopyToCtrl(m_CopyBuffer3, m_hWnd, IDC_WIN_COPY_3);
+	theApp.m_pPasteBuffer3->CopyToCtrl(m_PasteBuffer3, m_hWnd, IDC_WIN_PASTE_3);
+	theApp.m_pCutBuffer3->CopyToCtrl(m_CutBuffer3, m_hWnd, IDC_WIN_CUT_3);
+	CheckDlgButton(IDC_PLAY_SOUND_3, Item.m_bPlaySoundOnCopy);
+
+	return TRUE;
+}
+
+BOOL COptionsCopyBuffers::OnApply()
+{
+	ARRAY keys;
+	g_HotKeys.GetKeys(keys); // save old keys just in case new ones are invalid
+
+	theApp.m_pCopyBuffer1->CopyFromCtrl(m_CopyBuffer1, m_hWnd, IDC_WIN_COPY_1);
+	theApp.m_pPasteBuffer1->CopyFromCtrl(m_PasteBuffer1, m_hWnd, IDC_WIN_PASTE_1);
+	theApp.m_pCutBuffer1->CopyFromCtrl(m_CutBuffer1, m_hWnd, IDC_WIN_CUT_1);
+
+	theApp.m_pCopyBuffer2->CopyFromCtrl(m_CopyBuffer2, m_hWnd, IDC_WIN_COPY_2);
+	theApp.m_pPasteBuffer2->CopyFromCtrl(m_PasteBuffer2, m_hWnd, IDC_WIN_PASTE_2);
+	theApp.m_pCutBuffer2->CopyFromCtrl(m_CutBuffer2, m_hWnd, IDC_WIN_CUT_2);
+
+	theApp.m_pCopyBuffer3->CopyFromCtrl(m_CopyBuffer3, m_hWnd, IDC_WIN_COPY_3);
+	theApp.m_pPasteBuffer3->CopyFromCtrl(m_PasteBuffer3, m_hWnd, IDC_WIN_PASTE_3);
+	theApp.m_pCutBuffer3->CopyFromCtrl(m_CutBuffer3, m_hWnd, IDC_WIN_CUT_3);
+
+	CCopyBufferItem Item;
+	g_Opt.GetCopyBufferItem(0, Item);
+	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_1);
+	g_Opt.SetCopyBufferItem(0, Item);
+
+	g_Opt.GetCopyBufferItem(1, Item);
+	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_2);
+	g_Opt.SetCopyBufferItem(1, Item);
+
+	g_Opt.GetCopyBufferItem(2, Item);
+	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_3);
+	g_Opt.SetCopyBufferItem(2, Item);
+
+	int x;
+	int y;
+	ARRAY NewKeys;
+	g_HotKeys.GetKeys(NewKeys);
+
+	if(g_HotKeys.FindFirstConflict(NewKeys, &x, &y))
+	{
+		CString str =  g_HotKeys.ElementAt(x)->GetName();
+		str += " and ";
+		str += g_HotKeys.ElementAt(y)->GetName();
+		str += " cannot be the same.";
+		MessageBox(str);
+		g_HotKeys.SetKeys(keys); // restore the original values
+		return FALSE;
+	}
+
+	g_HotKeys.SaveAllKeys();
+	g_HotKeys.RegisterAll(true);
+
+	return CPropertyPage::OnApply();
+}
+

+ 37 - 0
OptionsCopyBuffers.h

@@ -0,0 +1,37 @@
+#pragma once
+#include "afxcmn.h"
+
+
+// COptionsCopyBuffers dialog
+
+class COptionsCopyBuffers : public CPropertyPage
+{
+	DECLARE_DYNCREATE(COptionsCopyBuffers)
+
+public:
+	COptionsCopyBuffers();
+	~COptionsCopyBuffers();
+
+// Dialog Data
+	enum { IDD = IDD_OPTIONS_COPY_BUFFERS };
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+
+	// Generated message map functions
+	//{{AFX_MSG(COptionsCopyBuffers)
+	virtual BOOL OnInitDialog();
+	virtual BOOL OnApply();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+public:
+	CHotKeyCtrl m_CopyBuffer1;
+	CHotKeyCtrl m_PasteBuffer1;
+	CHotKeyCtrl m_CutBuffer1;
+	CHotKeyCtrl m_CopyBuffer2;
+	CHotKeyCtrl m_PasteBuffer2;
+	CHotKeyCtrl m_CutBuffer2;
+	CHotKeyCtrl m_CopyBuffer3;
+	CHotKeyCtrl m_PasteBuffer3;
+	CHotKeyCtrl m_CutBuffer3;
+};

+ 5 - 0
OptionsSheet.cpp

@@ -11,6 +11,7 @@
 #include "OptionsTypes.h"
 #include "About.h"
 #include "OptionFriends.h"
+#include "OptionsCopyBuffers.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -35,6 +36,7 @@ COptionsSheet::COptionsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectP
 	m_pTypes = NULL;
 	m_pAbout = NULL;
 	m_pFriends = NULL;
+	m_pCopyBuffers = NULL;
 }
 
 COptionsSheet::~COptionsSheet()
@@ -47,6 +49,7 @@ COptionsSheet::~COptionsSheet()
 	DELETE_PTR(m_pTypes);
 	DELETE_PTR(m_pAbout);
 	DELETE_PTR(m_pFriends);
+	DELETE_PTR(m_pCopyBuffers);
 }
 
 BEGIN_MESSAGE_MAP(COptionsSheet, CPropertySheet)
@@ -66,6 +69,7 @@ int COptionsSheet::DoModal()
 	m_pKeyBoardOptions = new COptionsKeyBoard;
 	m_pQuickPasteOptions = new COptionsQuickPaste;
 	m_pFriends = new COptionFriends;
+	m_pCopyBuffers = new COptionsCopyBuffers;
 	m_pStats = new COptionsStats;
 	m_pTypes = new COptionsTypes;
 	m_pAbout = new CAbout;
@@ -73,6 +77,7 @@ int COptionsSheet::DoModal()
 	AddPage(m_pGeneralOptions);
 	AddPage(m_pTypes);
 	AddPage(m_pKeyBoardOptions);
+	AddPage(m_pCopyBuffers);
 	AddPage(m_pQuickPasteOptions);
 	AddPage(m_pFriends);
 	AddPage(m_pStats);

+ 1 - 0
OptionsSheet.h

@@ -47,6 +47,7 @@ protected:
 	CPropertyPage *m_pTypes;
 	CPropertyPage *m_pAbout;
 	CPropertyPage *m_pFriends;
+	CPropertyPage *m_pCopyBuffers;
 
 
 	//{{AFX_MSG(COptionsSheet)

+ 4 - 4
ProcessPaste.cpp

@@ -91,7 +91,7 @@ BOOL CProcessPaste::DoDrag()
 
 void CProcessPaste::MarkAsPasted()
 {
-	Log(_T("start of MarkAsPasted"));
+//	Log(_T("start of MarkAsPasted"));
 
 	CClipIDs& clips = GetClipIDs();
 	if(clips.GetSize() == 1)
@@ -107,7 +107,7 @@ void CProcessPaste::MarkAsPasted()
 		AfxBeginThread(CProcessPaste::MarkAsPastedThread, (LPVOID)lID, THREAD_PRIORITY_LOWEST);
 	}
 
-	Log(_T("End of MarkAsPasted"));
+//	Log(_T("End of MarkAsPasted"));
 }
 
 UINT CProcessPaste::MarkAsPastedThread(LPVOID pParam)
@@ -115,7 +115,7 @@ UINT CProcessPaste::MarkAsPastedThread(LPVOID pParam)
 	static CEvent UpdateTimeEvent(TRUE, TRUE, _T("Ditto_Update_Clip_Time"), NULL);
 	UpdateTimeEvent.ResetEvent();
 
-	Log(_T("Start of MarkAsPastedThread"));
+//	Log(_T("Start of MarkAsPastedThread"));
 
 	//If running from a U3 device then wait a little before updating the db
 	//updating the db can take a second or two and it delays the act of pasting
@@ -158,7 +158,7 @@ UINT CProcessPaste::MarkAsPastedThread(LPVOID pParam)
 
 	CATCH_SQLITE_EXCEPTION
 
-	Log(_T("End of MarkAsPastedThread"));
+//	Log(_T("End of MarkAsPastedThread"));
 
 	UpdateTimeEvent.SetEvent();
 	return bRet;

+ 36 - 2
Resource.h

@@ -28,6 +28,7 @@
 #define IDD_MOVE_TO_GROUP               156
 #define IDD_DIALOG_REMOTE_FILE          157
 #define IDR_FILE_COPY                   158
+#define IDD_OPTIONS_COPY_BUFFERS        166
 #define IDC_PATH                        1000
 #define IDC_GET_PATH                    1001
 #define IDC_SELECT_SOUND                1002
@@ -90,6 +91,9 @@
 #define IDC_CHECK_SEND_PASTE            1042
 #define IDC_CHECK_LOG_SEND_RECIEVE      1042
 #define IDC_ENSURE                      1042
+#define IDC_PLAY_SOUND_1                1042
+#define IDC_PLAY_SOUND_2                1043
+#define IDC_PLAY_SOUND_3                1044
 #define IDD_OPTIONS_KEYSTROKES          2001
 #define IDC_HOTKEY                      2002
 #define IDC_DISPLAY_IN_SYSTEMTRAY       2003
@@ -196,6 +200,36 @@
 #define IDC_PROGRESS_FILE               2076
 #define IDC_PROGRESS_ALL_FILES          2077
 #define IDC_FILE_COPY                   2078
+#define IDC_STATIC_COPY_1               2079
+#define IDC_STATIC_PASTE_1              2080
+#define IDC_STATIC_CUT_1                2081
+#define IDC_COPY_1                      2082
+#define IDC_PASTE_1                     2083
+#define IDC_CUT_1                       2084
+#define IDC_WIN_COPY_1                  2085
+#define IDC_WIN_PASTE_1                 2086
+#define IDC_WIN_CUT_1                   2087
+#define IDC_BUFFER_GROUP_1              2088
+#define IDC_COPY_2                      2089
+#define IDC_WIN_COPY_2                  2090
+#define IDC_PASTE_2                     2091
+#define IDC_WIN_PASTE_2                 2092
+#define IDC_STATIC_COPY_2               2093
+#define IDC_STATIC_PASTE_2              2094
+#define IDC_CUT_2                       2095
+#define IDC_WIN_CUT_2                   2096
+#define IDC_STATIC_CUT_2                2097
+#define IDC_BUFFER_GROUP_2              2098
+#define IDC_COPY_3                      2099
+#define IDC_WIN_COPY_3                  2100
+#define IDC_PASTE_3                     2101
+#define IDC_WIN_PASTE_3                 2102
+#define IDC_STATIC_COPY_3               2103
+#define IDC_STATIC_PASTE_3              2104
+#define IDC_CUT_3                       2105
+#define IDC_WIN_CUT_3                   2106
+#define IDC_STATIC_CUT_3                2107
+#define IDC_BUFFER_GROUP_3              2108
 #define ID_FIRST_OPTION                 32771
 #define ID_FIRST_EXIT                   32772
 #define ID_FIRST_SHOWQUICKPASTE         32773
@@ -293,9 +327,9 @@
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        164
+#define _APS_NEXT_RESOURCE_VALUE        167
 #define _APS_NEXT_COMMAND_VALUE         32871
-#define _APS_NEXT_CONTROL_VALUE         2079
+#define _APS_NEXT_CONTROL_VALUE         2089
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif