Преглед на файлове

Added copy reason flag so i can add a message when we save a clip to a group

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@787 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden преди 10 години
родител
ревизия
28eaf9bea4
променени са 24 файла, в които са добавени 184 реда и са изтрити 45 реда
  1. 11 8
      Accels.cpp
  2. 6 3
      Accels.h
  3. 26 0
      CP_Main.cpp
  4. 7 0
      CP_Main.h
  5. 1 0
      Clip.cpp
  6. 2 0
      Clip.h
  7. 2 1
      CopyThread.cpp
  8. 1 1
      DittoCopyBuffer.cpp
  9. 3 1
      ExternalWindowTracker.cpp
  10. 3 1
      ExternalWindowTracker.h
  11. 8 1
      GlobalClips.cpp
  12. 3 3
      GroupTree.cpp
  13. 2 2
      MainFrm.cpp
  14. 27 8
      MainTableFunctions.cpp
  15. 12 1
      Misc.h
  16. 10 0
      Options.cpp
  17. 3 0
      Options.h
  18. 28 10
      QListCtrl.cpp
  19. 3 1
      QListCtrl.h
  20. 17 3
      QPasteWnd.cpp
  21. 1 0
      QPasteWnd.h
  22. 6 0
      QuickPaste.cpp
  23. 1 0
      SpecialPasteOptions.h
  24. 1 1
      UAC_Thread.cpp

+ 11 - 8
Accels.cpp

@@ -6,14 +6,17 @@ CAccels::CAccels(){
 
 }
 
-void CAccels::AddAccel(CAccel &a)
+void CAccels::AddAccel(CAccel a)
 {
-    m_Map.SetAt(a.Key, a.Cmd);
+    m_Map.SetAt(a.Key, a);
 }
 
 void CAccels::AddAccel(DWORD cmd, DWORD key)
 {
-	m_Map.SetAt(key, cmd);
+	CAccel a;
+	a.Cmd = cmd;
+	a.Key = key;
+	m_Map.SetAt(key, a);
 }
 
 void CAccels::RemoveAll()
@@ -26,12 +29,12 @@ CString CAccels::GetCmdKeyText(DWORD cmd)
 	CString cmdShortcutText = _T("");
 	POSITION pos = m_Map.GetStartPosition();
 	DWORD mapShortcut;
-	DWORD mapCmd;
+	CAccel a;
 	while (pos != NULL)
 	{
-		m_Map.GetNextAssoc(pos, mapShortcut, mapCmd);
+		m_Map.GetNextAssoc(pos, mapShortcut, a);
 
-		if(mapCmd == cmd)
+		if(a.Cmd == cmd)
 		{
 			cmdShortcutText = CHotKey::GetHotKeyDisplayStatic(mapShortcut);
 			break;
@@ -41,7 +44,7 @@ CString CAccels::GetCmdKeyText(DWORD cmd)
 	return cmdShortcutText;
 }
 
-bool CAccels::OnMsg(MSG *pMsg, DWORD &dID)
+bool CAccels::OnMsg(MSG *pMsg, CAccel &a)
 {
     // bit 30 (0x40000000) is 1 if this is NOT the first msg of the key
     //  i.e. auto-repeat may cause multiple msgs of the same key
@@ -63,7 +66,7 @@ bool CAccels::OnMsg(MSG *pMsg, DWORD &dID)
     cs.Format(_T("Key: %d, Mod: %d, vkey: %d"), key, mod, vkey);
     OutputDebugString(cs);
 
-    if(m_Map.Lookup(key, dID))
+    if(m_Map.Lookup(key, a))
     {
         return true;
     }

+ 6 - 3
Accels.h

@@ -9,10 +9,12 @@ class CAccel
 public:
     DWORD Key;
     DWORD Cmd;
+	int RefId;
     CAccel(DWORD key = 0, DWORD cmd = 0)
     {
         Key = key;
         Cmd = cmd;
+		RefId = 0;
     }
 };
 
@@ -24,7 +26,8 @@ class CAccels
 public:
     CAccels();
 
-    void AddAccel(CAccel &a);
+    void AddAccel(CAccel a);
+
 	void AddAccel(DWORD cmd, DWORD key);
 
 	void RemoveAll();
@@ -34,10 +37,10 @@ public:
     // handles a key's first WM_KEYDOWN or WM_SYSKEYDOWN message.
     // it uses GetKeyState to test for modifiers.
     // returns a pointer to the internal CAccel if it matches the given key or NULL
-    bool OnMsg(MSG *pMsg, DWORD &dID);
+    bool OnMsg(MSG *pMsg, CAccel &a);
 
     static BYTE GetKeyStateModifiers();
 
 protected:
-	CMap < DWORD, DWORD, DWORD, DWORD > m_Map;
+	CMap < DWORD, DWORD, CAccel, CAccel > m_Map;
 };

+ 26 - 0
CP_Main.cpp

@@ -107,6 +107,8 @@ CCP_MainApp::CCP_MainApp()
 {
 	theApp.m_activeWnd.TrackActiveWnd(false);
 
+	m_copyReason = CopyReasonEnum::COPY_TO_UNKOWN;
+	m_copyReasonStartTime = 0;
 	m_activeGroupId = -1;
 	m_activeGroupStartTime = 0;
 	m_pUacPasteThread = NULL;
@@ -1153,5 +1155,29 @@ int CCP_MainApp::GetActiveGroupId()
 	m_activeGroupId = -1;
 	m_activeGroupStartTime = 0;
 
+	return ret;
+}
+
+void CCP_MainApp::SetCopyReason(CopyReasonEnum::CopyReason copyReason)
+{
+	m_copyReason = copyReason;
+	m_copyReasonStartTime = GetTickCount();
+}
+
+CopyReasonEnum::CopyReason CCP_MainApp::GetCopyReason()
+{
+	CopyReasonEnum::CopyReason ret = CopyReasonEnum::COPY_TO_UNKOWN;
+	DWORD maxDiff = CGetSetOptions::GetCopyReasonTimeoutMS();
+	DWORD diff = GetTickCount() - m_copyReasonStartTime;
+
+	if(m_copyReason != CopyReasonEnum::COPY_TO_UNKOWN &&
+		diff < maxDiff)
+	{
+		ret = m_copyReason;
+	}
+
+	m_copyReason = CopyReasonEnum::COPY_TO_UNKOWN;
+	m_copyReasonStartTime = 0;
+
 	return ret;
 }

+ 7 - 0
CP_Main.h

@@ -129,6 +129,7 @@ public:
 	long GetValidGroupID(); // returns a valid id (not negative)
 	void SetGroupDefaultID(long lID); // sets a valid id
 
+
 // Window States
 	// the ID given focus by CQPasteWnd::FillList
 	long	m_FocusID;
@@ -184,6 +185,9 @@ public:
 	void SetActiveGroupId(int groupId);
 	int GetActiveGroupId();
 
+	void SetCopyReason(CopyReasonEnum::CopyReason copyReason);
+	CopyReasonEnum::CopyReason GetCopyReason();
+
 
 public:
 	virtual BOOL InitInstance();
@@ -199,4 +203,7 @@ protected:
 
 	int m_activeGroupId;
 	DWORD m_activeGroupStartTime;
+
+	CopyReasonEnum::CopyReason m_copyReason;
+	DWORD m_copyReasonStartTime;
 };

+ 1 - 0
Clip.cpp

@@ -176,6 +176,7 @@ CClip::CClip() :
 	m_moveToGroupShortCut(0),
 	m_globalMoveToGroupShortCut(FALSE)
 {
+	m_copyReason = CopyReasonEnum::COPY_TO_UNKOWN;
 }
 
 CClip::~CClip()

+ 2 - 0
Clip.h

@@ -12,6 +12,7 @@
 #include <afxtempl.h>
 #include "tinyxml\tinyxml.h"
 #include "Shared\IClip.h"
+#include "Misc.h"
 
 class CClip;
 class CCopyThread;
@@ -107,6 +108,7 @@ public:
 	CTime m_lastPasteDate;
 	int m_moveToGroupShortCut;
 	BOOL m_globalMoveToGroupShortCut;
+	CopyReasonEnum::CopyReason m_copyReason;
 
 	virtual CString Description() { return m_Desc; }
 	virtual void Description(CString csValue) { m_Desc = csValue; }

+ 2 - 1
CopyThread.cpp

@@ -66,8 +66,9 @@ void CCopyThread::OnClipboardChange()
 	{
 		Log(StrF(_T("LoadFromClipboard - loading clips into groupId: %d"), groupId));
 	}
-
+	
 	CClip* pClip = new CClip;
+	pClip->m_copyReason = theApp.GetCopyReason();
 
 	CClipTypes* pSupportedTypes = m_LocalConfig.m_pSupportedTypes;
 	bool bDeleteMemory = false;

+ 1 - 1
DittoCopyBuffer.cpp

@@ -35,7 +35,7 @@ bool CDittoCopyBuffer::StartCopy(long lCopyBuffer, bool bCut)
 		}
 		else
 		{
-			theApp.m_activeWnd.SendCopy();
+			theApp.m_activeWnd.SendCopy(CopyReasonEnum::COPY_TO_BUFFER);
 		}
 
 		//Create a thread to track if they have copied anything, if thread has exited before they have

+ 3 - 1
ExternalWindowTracker.cpp

@@ -272,7 +272,7 @@ void ExternalWindowTracker::SendPaste(bool activateTarget)
 	Log(_T("Post sending paste"));
 }
 
-void ExternalWindowTracker::SendCopy()
+void ExternalWindowTracker::SendCopy(CopyReasonEnum::CopyReason copyReason)
 {
 	CSendKeys send;
 	send.AllKeysUp();
@@ -312,6 +312,8 @@ void ExternalWindowTracker::SendCopy()
 		Sleep(delay);
 		send.SetKeyDownDelay(max(50, delay));
 
+		theApp.SetCopyReason(copyReason);
+
 		send.SendKeys(csString, true);
 	}	
 

+ 3 - 1
ExternalWindowTracker.h

@@ -1,5 +1,7 @@
 #pragma once
 
+#include "Misc.h"
+
 class ExternalWindowTracker
 {
 public:
@@ -19,7 +21,7 @@ public:
 
 	void SendPaste(bool activateTarget);
 	void SendCut();
-	void SendCopy();
+	void SendCopy(CopyReasonEnum::CopyReason copyReason);
 
 	bool NotifyTrayhWnd(HWND hWnd);
 

+ 8 - 1
GlobalClips.cpp

@@ -79,7 +79,14 @@ void GlobalClips::LoadItems()
 
 		if(pHotKey->m_clipId > 0)
 		{
-			strItem.Insert(0, theApp.m_Language.GetGlobalHotKeyString("(Clip)", "(Clip) "));
+			if(pHotKey->m_hkType == CHotKey::PASTE_OPEN_CLIP)
+			{
+				strItem.Insert(0, theApp.m_Language.GetGlobalHotKeyString("(Clip)", "(Clip) "));
+			}
+			else if(pHotKey->m_hkType == CHotKey::MOVE_TO_GROUP)
+			{
+				strItem.Insert(0, _T("(Move To Group) "));
+			}
 		}
 
 		lvi.iSubItem = 0;

+ 3 - 3
GroupTree.cpp

@@ -96,11 +96,11 @@ BOOL CGroupTree::PreTranslateMessage(MSG *pMsg)
 bool CGroupTree::CheckActions(MSG * pMsg) 
 {
 	bool ret = false;
-	DWORD dID;
+	CAccel a;
 
-	if (m_actions.OnMsg(pMsg, dID))
+	if (m_actions.OnMsg(pMsg, a))
 	{
-		ret = DoAction(dID);
+		ret = DoAction(a.Cmd);
 	}   
 
 	return ret;

+ 2 - 2
MainFrm.cpp

@@ -384,7 +384,7 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
 					m_doubleClickGroupStartTime = 0;
 
 					theApp.SetActiveGroupId(g_HotKeys[i]->m_clipId);
-					theApp.m_activeWnd.SendCopy();
+					theApp.m_activeWnd.SendCopy(CopyReasonEnum::COPY_TO_GROUP);
 				}
 
 				break;
@@ -494,7 +494,7 @@ void CMainFrame::PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarg
 				m_doubleClickGroupStartTime = 0;
 
 				theApp.SetActiveGroupId(dbId);
-				theApp.m_activeWnd.SendCopy();
+				theApp.m_activeWnd.SendCopy(CopyReasonEnum::COPY_TO_GROUP);
 			}
 			else
 			{

+ 27 - 8
MainTableFunctions.cpp

@@ -31,17 +31,36 @@ void CMainTableFunctions::LoadAcceleratorKeys(CAccels& accels, CppSQLite3DB &db)
 {
 	try
 	{
-		CppSQLite3Query q = db.execQuery(_T("SELECT lID, lShortCut FROM Main WHERE lShortCut > 0"));
-		
-		CAccel a;
-		while(q.eof() == false)
 		{
-			a.Cmd = q.getIntField(_T("lID"));
-			a.Key = q.getIntField(_T("lShortCut"));
+			CppSQLite3Query q = db.execQuery(_T("SELECT lID, lShortCut FROM Main WHERE lShortCut > 0"));
+		
+			CAccel a;
+			while(q.eof() == false)
+			{
+				a.Cmd = q.getIntField(_T("lID"));
+				a.Key = q.getIntField(_T("lShortCut"));
+				a.RefId = CHotKey::PASTE_OPEN_CLIP;
 			
-			accels.AddAccel(a);
+				accels.AddAccel(a);
+
+				q.nextRow();
+			}
+		}
+
+		{
+			CppSQLite3Query q2 = db.execQuery(_T("SELECT lID, MoveToGroupShortCut FROM Main WHERE MoveToGroupShortCut > 0"));
+
+			CAccel a2;
+			while(q2.eof() == false)
+			{
+				a2.Cmd = q2.getIntField(_T("lID"));
+				a2.Key = q2.getIntField(_T("MoveToGroupShortCut"));
+				a2.RefId = CHotKey::MOVE_TO_GROUP;
 
-			q.nextRow();
+				accels.AddAccel(a2);
+
+				q2.nextRow();
+			}
 		}
 	}
 	CATCH_SQLITE_EXCEPTION

+ 12 - 1
Misc.h

@@ -12,6 +12,17 @@
 #define ONE_HOUR				3600000
 #define ONE_DAY					86400000
 
+class CopyReasonEnum
+{
+public:
+	enum CopyReason
+	{ 
+		COPY_TO_UNKOWN,
+		COPY_TO_GROUP,
+		COPY_TO_BUFFER
+	};
+};
+
 #define INVALID_STICKY	-(2147483647)
 
 #define CATCH_SQLITE_EXCEPTION		\
@@ -55,7 +66,7 @@ CString GetErrorString(int err);
 
 double IdleSeconds();
 
-#define LogSendRecieveInfo(cs) logsendrecieveinfo(cs, __FILE__, __LINE__)
+#define LogSendRecieveInfo(cs) logsendrecieveinfo(cs, __FILE__, __LINE__);
 void logsendrecieveinfo(CString cs, CString csFile = _T(""), long lLine = -1);
 
 // Utility Functions

+ 10 - 0
Options.cpp

@@ -2237,4 +2237,14 @@ void CGetSetOptions::SetSaveToGroupTimeoutMS(int val)
 int CGetSetOptions::GetSaveToGroupTimeoutMS()
 {
 	return GetProfileLong(_T("SaveToGroupTimeoutMS"), 1000);
+}
+
+void CGetSetOptions::SetCopyReasonTimeoutMS(int val)
+{
+	SetProfileLong(_T("CopyReasonTimeoutMS"), val);
+}
+
+int CGetSetOptions::GetCopyReasonTimeoutMS()
+{
+	return GetProfileLong(_T("CopyReasonTimeoutMS"), 1000);
 }

+ 3 - 0
Options.h

@@ -486,6 +486,9 @@ public:
 
 	static void SetSaveToGroupTimeoutMS(int val);
 	static int GetSaveToGroupTimeoutMS();
+
+	static void SetCopyReasonTimeoutMS(int val);
+	static int GetCopyReasonTimeoutMS();
 };
 
 // global for easy access and for initialization of fast access variables

+ 28 - 10
QListCtrl.cpp

@@ -26,6 +26,8 @@ static char THIS_FILE[] = __FILE__;
 #define TIMER_HIDE_SCROL	2
 #define TIMER_SHOW_SCROLL	3
 
+#define VALID_TOOLTIP (m_pToolTip && ::IsWindow(m_pToolTip->m_hWnd))
+
 
 /////////////////////////////////////////////////////////////////////////////
 // CQListCtrl
@@ -748,10 +750,10 @@ int CQListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
 
 BOOL CQListCtrl::PreTranslateMessage(MSG* pMsg) 
 {
-	DWORD dID;
-	if(m_Accels.OnMsg(pMsg, dID))
+	CAccel a;
+	if(m_Accels.OnMsg(pMsg, a))
 	{
-		switch(dID)
+		switch(a.Cmd)
 		{
 		case COPY_BUFFER_HOT_KEY_1_ID:
 			PutSelectedItemOnDittoCopyBuffer(0);
@@ -763,13 +765,20 @@ BOOL CQListCtrl::PreTranslateMessage(MSG* pMsg)
 			PutSelectedItemOnDittoCopyBuffer(2);
 			break;
 		default:
-			GetParent()->SendMessage(NM_SELECT_DB_ID, dID, 0);
+			if(a.RefId == CHotKey::PASTE_OPEN_CLIP)
+			{
+				GetParent()->SendMessage(NM_SELECT_DB_ID, a.Cmd, 0);
+			}
+			else if(a.RefId == CHotKey::MOVE_TO_GROUP)
+			{
+				GetParent()->SendMessage(NM_MOVE_TO_GROUP, a.Cmd, 0);
+			}
 		}
 
 		return TRUE;
 	}
 
-	if(m_pToolTip)
+	if(VALID_TOOLTIP)
 	{
 		if(m_pToolTip->OnMsg(pMsg))
 			return TRUE;
@@ -793,7 +802,7 @@ BOOL CQListCtrl::PreTranslateMessage(MSG* pMsg)
 
 BOOL CQListCtrl::HandleKeyDown(WPARAM wParam, LPARAM lParam)
 {
-	if(m_pToolTip)
+	if(VALID_TOOLTIP)
 	{
 		MSG Msg;
 		Msg.lParam = lParam;
@@ -922,7 +931,7 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 
 	int clipId = this->GetItemData(this->GetCaret());
 
-	if(m_pToolTip != NULL && 
+	if(VALID_TOOLTIP && 
 		m_pToolTip->GetClipId() == clipId &&
 		::IsWindow(m_toolTipHwnd))
 	{
@@ -964,7 +973,7 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 		m_toolTipHwnd = m_pToolTip->GetSafeHwnd();
 		m_pToolTip->SetNotifyWnd(GetParent());
 	}
-	else
+	else if(VALID_TOOLTIP)
 	{
 		CRect r;
 		m_pToolTip->GetWindowRect(r);
@@ -976,7 +985,7 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 		
 	}
 	
-	if(m_pToolTip)
+	if(VALID_TOOLTIP)
 	{
 		m_pToolTip->SetClipId(clipId);
 		m_pToolTip->SetSearchText(m_searchText);
@@ -1240,7 +1249,10 @@ void CQListCtrl::OnKillFocus(CWnd* pNewWnd)
 
 HWND CQListCtrl::GetToolTipHWnd()
 {
-	return m_pToolTip->GetSafeHwnd();
+	if(VALID_TOOLTIP)
+		return m_pToolTip->GetSafeHwnd();
+
+	return NULL;
 }
 
 BOOL CQListCtrl::SetItemCountEx(int iCount, DWORD dwFlags /* = 0 */)
@@ -1465,3 +1477,9 @@ void CQListCtrl::SetSearchText(CString text)
 { 
 	m_searchText = text;
 }
+
+void CQListCtrl::HidePopup()
+{ 
+	if(VALID_TOOLTIP) 
+		m_pToolTip->Hide();	
+}

+ 3 - 1
QListCtrl.h

@@ -41,6 +41,8 @@
 #define NM_SHOW_PROPERTIES			WM_USER+0x125
 #define NM_NEW_GROUP				WM_USER+0x126
 #define NM_DELETE_ID				WM_USER+0x127
+#define NM_MOVE_TO_GROUP			WM_USER+0x128
+
 
 
 #define COPY_BUFFER_HOT_KEY_1_ID	-100
@@ -131,7 +133,7 @@ public:
 	bool ShowFullDescription(bool bFromAuto = false, bool fromNextPrev = false);
 	BOOL SetItemCountEx(int iCount, DWORD dwFlags = 0);
 
-	void HidePopup()	{ if(m_pToolTip) m_pToolTip->Hide();	}
+	void HidePopup();
 
 	void SetLogFont(LOGFONT &font);
 

+ 17 - 3
QPasteWnd.cpp

@@ -232,6 +232,7 @@ ON_COMMAND(ID_MENU_WILDCARDSEARCH, &CQPasteWnd::OnMenuWildcardsearch)
 
 ON_COMMAND(ID_MENU_SAVECURRENTCLIPBOARD, &CQPasteWnd::OnMenuSavecurrentclipboard)
 ON_UPDATE_COMMAND_UI(ID_MENU_SAVECURRENTCLIPBOARD, &CQPasteWnd::OnUpdateMenuSavecurrentclipboard)
+ON_MESSAGE(NM_MOVE_TO_GROUP, OnListMoveSelectionToGroup)
 END_MESSAGE_MAP()
 
 
@@ -822,6 +823,19 @@ LRESULT CQPasteWnd::OnListSelect_DB_ID(WPARAM wParam, LPARAM lParam)
     return TRUE;
 }
 
+LRESULT CQPasteWnd::OnListMoveSelectionToGroup(WPARAM wParam, LPARAM lParam)
+{
+	int groupId = (int)wParam;
+	if(groupId >= -1)
+	{
+		CClipIDs IDs;
+		m_lstHeader.GetSelectionItemData(IDs);
+
+		IDs.MoveTo(groupId);
+	}
+	return TRUE;
+}
+
 LRESULT CQPasteWnd::OnListSelect_Index(WPARAM wParam, LPARAM lParam)
 {
     if((int)wParam >= m_lstHeader.GetItemCount())
@@ -2625,11 +2639,11 @@ BOOL CQPasteWnd::PreTranslateMessage(MSG *pMsg)
 bool CQPasteWnd::CheckActions(MSG * pMsg) 
 {
 	bool ret = false;
-	DWORD dID;
+	CAccel a;
 
-	if (m_actions.OnMsg(pMsg, dID))
+	if (m_actions.OnMsg(pMsg, a))
 	{
-		ret = DoAction(dID);
+		ret = DoAction(a.Cmd);
 	}   
 
 	return ret;

+ 1 - 0
QPasteWnd.h

@@ -337,6 +337,7 @@ protected:
     afx_msg LRESULT OnDelete(WPARAM wParam, LPARAM lParam);
     afx_msg void OnGetToolTipText(NMHDR *pNMHDR, LRESULT *pResult);
     afx_msg LRESULT OnListSelect_DB_ID(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnListMoveSelectionToGroup(WPARAM wParam, LPARAM lParam);
     afx_msg LRESULT OnListSelect_Index(WPARAM wParam, LPARAM lParam);
     afx_msg LRESULT OnRefreshView(WPARAM wParam, LPARAM lParam);
 	afx_msg LRESULT OnReloadClipOrder(WPARAM wParam, LPARAM lParam);

+ 6 - 0
QuickPaste.cpp

@@ -58,7 +58,10 @@ BOOL CQuickPaste::CloseQPasteWnd()
 	if(m_pwndPaste)
 	{		
 		if(m_pwndPaste)
+		{
 			m_pwndPaste->CloseWindow();
+			m_pwndPaste->DestroyWindow();
+		}
 
 		Log(_T("CloseQPasteWnd called closing qpastewnd"));
 		
@@ -76,7 +79,10 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 	if(bFromKeyboard == false && GetKeyState(VK_SHIFT) & 0x8000 && GetKeyState(VK_CONTROL) & 0x8000)
 	{
 		if(m_pwndPaste)
+		{
+			m_pwndPaste->CloseWindow();
 			m_pwndPaste->DestroyWindow();
+		}
 
 		Log(_T("CloseQPasteWnd called closing qpastewnd from keyboard"));
 

+ 1 - 0
SpecialPasteOptions.h

@@ -8,6 +8,7 @@ public:
 	~CSpecialPasteOptions();
 
 	bool m_pasteAsPlainText;
+	bool m_pasteRTFNoTextHighlight;
 	CClipFormats *m_pPasteFormats;
 
 	CString ToString();

+ 1 - 1
UAC_Thread.cpp

@@ -66,7 +66,7 @@ void CUAC_Thread::OnEvent(int eventId, void *param)
 		theApp.m_activeWnd.SendPaste(false);
 		break; 
 	case UAC_COPY:
-		theApp.m_activeWnd.SendCopy();
+		theApp.m_activeWnd.SendCopy(CopyReasonEnum::COPY_TO_UNKOWN);
 		break; 
 	case UAC_CUT:
 		theApp.m_activeWnd.SendCut();