Browse Source

be sure the next clipboard viewer is not your self if it was it was getting into a infinate loop.
[SAB]


git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@132 595ec19a-5cb4-439b-94a8-42fb3063c22c

sabrogden 21 years ago
parent
commit
983ac75916
1 changed files with 19 additions and 3 deletions
  1. 19 3
      ProcessCopy.cpp

+ 19 - 3
ProcessCopy.cpp

@@ -985,8 +985,15 @@ void CClipboardViewer::OnChangeCbChain(HWND hWndRemove, HWND hWndAfter)
     // Otherwise, pass the message to the next link.
 	else if (m_hNextClipboardViewer != NULL)
     {
-		::SendMessage ( m_hNextClipboardViewer, WM_CHANGECBCHAIN, 
-			(WPARAM) hWndRemove, (LPARAM) hWndAfter );
+		if(m_hNextClipboardViewer != m_hWnd)
+		{
+			::SendMessage ( m_hNextClipboardViewer, WM_CHANGECBCHAIN, 
+				(WPARAM) hWndRemove, (LPARAM) hWndAfter );
+		}
+		else
+		{
+			m_hNextClipboardViewer = NULL;
+		}
     }
 }
 
@@ -1008,7 +1015,16 @@ void CClipboardViewer::OnDrawClipboard()
 	
 	// pass the event to the next Clipboard viewer in the chain
 	if( m_hNextClipboardViewer != NULL )
-		::SendMessage(m_hNextClipboardViewer, WM_DRAWCLIPBOARD, 0, 0);	
+	{
+		if(m_hNextClipboardViewer != m_hWnd)
+		{
+			::SendMessage(m_hNextClipboardViewer, WM_DRAWCLIPBOARD, 0, 0);	
+		}
+		else
+		{
+			m_hNextClipboardViewer = NULL;
+		}
+	}
 }
 
 void CClipboardViewer::OnTimer(UINT nIDEvent)