<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CImageList Flimmert]]></title><description><![CDATA[<p>hi</p>
<p>bin gerade eine Drag 'n' Drop Funktion für mein CListCtrl am schreiben. Das Problem ist aber wenn ich die Mouse mit dem &quot;gedraggten&quot; Item bewege Flimmert es wie sau.</p>
<p>Was kann ich dagegen tun???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/54853/cimagelist-flimmert</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 21:29:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/54853.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Nov 2003 14:39:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 14:39:07 GMT]]></title><description><![CDATA[<p>hi</p>
<p>bin gerade eine Drag 'n' Drop Funktion für mein CListCtrl am schreiben. Das Problem ist aber wenn ich die Mouse mit dem &quot;gedraggten&quot; Item bewege Flimmert es wie sau.</p>
<p>Was kann ich dagegen tun???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/391777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/391777</guid><dc:creator><![CDATA[de_Bert]]></dc:creator><pubDate>Tue, 11 Nov 2003 14:39:07 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 14:48:16 GMT]]></title><description><![CDATA[<p>Nicht dauernd neu zeichnen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/391785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/391785</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Tue, 11 Nov 2003 14:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 14:52:07 GMT]]></title><description><![CDATA[<p>hi</p>
<p>ja und wie soll ich das Machen??? Habe die DragMove in die OnMouseMove hineingelegt. Wo soll ich sie statt dessen hinverlegen???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/391788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/391788</guid><dc:creator><![CDATA[de_Bert]]></dc:creator><pubDate>Tue, 11 Nov 2003 14:52:07 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 14:59:43 GMT]]></title><description><![CDATA[<p>Hmm, keine Ahnung. Ich wusste blos, dass so ein Flimmern wohl vom zu oft neu Zeichnen kommt. Vielleicht geht es ja auch, wenn du einen kleineren Bereich neu zeichnest?<br />
Drag &amp; Drop ist sonst leider nicht meine Stärke. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/391798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/391798</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Tue, 11 Nov 2003 14:59:43 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 15:08:41 GMT]]></title><description><![CDATA[<p>hat noch jemand eine Idee???</p>
<p>Könnte man auch eine Klasse von CImageList ableiten und dann die Zeichenfunktion ünerladen und dadurch das Flimmern verhinden???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/391809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/391809</guid><dc:creator><![CDATA[de_Bert]]></dc:creator><pubDate>Tue, 11 Nov 2003 15:08:41 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Tue, 11 Nov 2003 20:05:36 GMT]]></title><description><![CDATA[<p>CImageList ist sicher nicht Schuld. Es liegt an dir bzw. an deiner Anwendung. Zeig mal ein bißchen Code.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/392087</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/392087</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Tue, 11 Nov 2003 20:05:36 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Wed, 12 Nov 2003 07:13:14 GMT]]></title><description><![CDATA[<p>hi hier ist ein bissel Quellcode.</p>
<pre><code class="language-cpp">void CXListCtrl::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	// TODO: Code für die Behandlungsroutine der Steuerelement-Benachrichtigung hier einfügen

	m_nDragIndex = pNMListView-&gt;iItem;

	/* Ein Verschieben von Target Items ist nicht möglich (Anfang)*/
	XLISTCTRLDATA *pXLCD = (XLISTCTRLDATA*)CListCtrl::GetItemData( pNMListView-&gt;iItem );

	if( pXLCD[0].bTargetVolume == TRUE )
	{
		AfxMessageBox(&quot;Das verschieben von Rootitems ist nicht möglich&quot;, MB_OK, 0);
		return;
	}

	POINT pt;
	int nOffset = 10;

	pt.x = nOffset;
	pt.y = nOffset;

	/* Old */
	//m_pDragImage = this-&gt;CreateDragImage( m_nDragIndex, &amp;pt );
	//ASSERT( m_pDragImage );
	//CBitmap Drag;
	//Drag.LoadBitmap( IDB_DRAGDROP );
	//m_pDragImage-&gt;Replace( 0, &amp;Drag, &amp;Drag );

	CRect rect, HeaderRect;
	GetItemRect(m_nDragIndex, rect, LVIR_BOUNDS);
	//m_HeaderCtrl.GetItemRect( m_nDragIndex, &amp;HeaderRect);

	// Create bitmap
	CClientDC	dc( this );
	CDC 		memDC;
	CBitmap		bitmap;

	memDC.CreateCompatibleDC(&amp;dc);
	bitmap.CreateCompatibleBitmap(&amp;dc, rect.Width(), rect.Height());

	CBitmap* pOldMemDCBitmap = memDC.SelectObject( &amp;bitmap );
	CFont* pOldFont = memDC.SelectObject(GetFont());

	memDC.FillSolidRect( 0, 0, rect.Width(), rect.Height(), RGB(0,255,0));
	memDC.SetTextColor(RGB(0,0,0));

	for( int i = 0; i &lt; GetColumns(); i++ )
	{
		CRect ClientFull = rect;
		m_HeaderCtrl.GetItemRect( i, &amp;HeaderRect);

		ClientFull.left = HeaderRect.left;
		ClientFull.right = HeaderRect.right;
		ClientFull.top = 0;
		ClientFull.bottom = rect.Height();

		if( pXLCD[i].nCheckedState != -1 )
		{
			this-&gt;DrawCheckbox( m_nDragIndex, i, &amp;memDC, RGB(0,0,0), RGB(0,255,0), ClientFull, pXLCD, FALSE);
		}
		else
		{
			this-&gt;DrawText( m_nDragIndex, i, &amp;memDC, RGB(255,0,0), RGB(0,255,0), ClientFull, pXLCD, FALSE);
		}
	}

	memDC.SelectObject( pOldFont );
	memDC.SelectObject( pOldMemDCBitmap );

	// Create imagelist
	m_pDragImage = new CImageList;
	m_pDragImage-&gt;Create(rect.Width(), rect.Height(), ILC_COLOR | ILC_MASK, 0, 1);
	m_pDragImage-&gt;Add(&amp;bitmap, RGB(0, 255, 0)); // Here green is used as mask color

	m_pDragImage-&gt;BeginDrag( 0, CPoint( pNMListView-&gt;ptAction.x, nOffset ) );
	m_pDragImage-&gt;DragEnter( GetDesktopWindow(), pNMListView-&gt;ptAction );

	// Set Dragging flag and other
	m_bDragging = TRUE;
	m_nDropIndex = -1;
	m_pDragWnd = this;
	m_pDropWnd = this;

	SetCapture();

	*pResult = 0;
}
</code></pre>
<pre><code class="language-cpp">void CXListCtrl::OnMouseMove(UINT nFlags, CPoint point) 
{
	// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
	if( m_bDragging )
	{
		CPoint pt( point );
		ClientToScreen( &amp;pt );

		/* Herausfinden ob sich der Mauszeiger am oberen Rand bzw. unteren Rand befindet */
			CRect ListClient;
			CRect HeaderClient;
			GetClientRect(&amp;ListClient);
			m_HeaderCtrl.GetClientRect( &amp;HeaderClient);
			ListClient.top += HeaderClient.bottom;

			// Befindet sich der Mauszeiger am oberen Rand dann nach oben Scrollen
			if( ListClient.top == point.y || ListClient.top+5 &gt; point.y)
			{
				// WM_TIMER Nachrichten senden
				SetTimer( 6, 200, NULL);
			}
			else
			{	
				// Wm_TIMER Nachrichten nicht mehr senden
				KillTimer( 6 );	
			}

			// Befindet sich der Mauszeiger am unteren Rand dann nach unten Scrollen
			if( ListClient.bottom == point.y || ListClient.bottom - 5 &lt; point.y)
			{
				// WM_TIMER Nachrichten senden
				SetTimer( 5, 200, NULL);
			}
			else
			{
				// Wm_TIMER Nachrichten nicht mehr senden
				KillTimer( 5 );	
			}
		/* Herausfinden ob sich der Mauszeiger am oberen Rand bzw. unteren Rand befindet */

		m_pDragImage-&gt;DragMove( pt );
		m_pDragImage-&gt;DragShowNolock( FALSE );

		// Get the CWnd pointer of the window that is under the
		// mouse cursor
        CXListCtrl* pDropWnd = (CXListCtrl*)WindowFromPoint(pt);
        ASSERT(pDropWnd);						// make sure we have a window

		// If we drag outside current window we need 
        // to adjust the highlights displayed
        if( pDropWnd != m_pDropWnd )
        {
            // If we drag over the CListCtrl header, turn off the
			// hover highlight
            if( m_nDropIndex != -1 )
            {
                TRACE(&quot;m_nDropIndex is -1\n&quot;);
                CXListCtrl* pList = (CXListCtrl*)m_pDropWnd;
                VERIFY (pList-&gt;SetItemState (m_nDropIndex, 0, LVIS_DROPHILITED));
                // redraw item
                //VERIFY (pList-&gt;RedrawItems (m_nDropIndex, m_nDropIndex));
                //pList-&gt;UpdateWindow ();
                m_nDropIndex = -1;
            }
            else //If we drag out of the CListCtrl altogether
            {
                TRACE(&quot;m_nDropIndex is not -1\n&quot;);
                CXListCtrl* pList = (CXListCtrl*)m_pDropWnd;
                int i = 0;
                int nCount = pList-&gt;GetItemCount();
                for(i = 0; i &lt; nCount; i++)
                {
                    pList-&gt;SetItemState(i, 0, LVIS_DROPHILITED);
                }
                //pList-&gt;RedrawItems(0, nCount);
                //pList-&gt;UpdateWindow();
            }
        }
		// Save current window pointer as the CListCtrl we are dropping onto
        m_pDropWnd = pDropWnd;

        // Convert from screen coordinates to drop target client coordinates
        pDropWnd-&gt;ScreenToClient(&amp;pt);

		//If we are hovering over a CListCtrl we need to adjust the highlights
        if(pDropWnd-&gt;IsKindOf(RUNTIME_CLASS (CListCtrl)))
        {            
            UINT uFlags;
            CXListCtrl* pList = (CXListCtrl*)pDropWnd;

            // Turn off hilight for previous drop target
            pList-&gt;SetItemState (m_nDropIndex, 0, LVIS_DROPHILITED);
            // Redraw previous item
            //pList-&gt;RedrawItems (m_nDropIndex, m_nDropIndex);

            // Get the item that is below cursor
            m_nDropIndex = ((CListCtrl*)pDropWnd)-&gt;HitTest(pt, &amp;uFlags);
            // Highlight it
            pList-&gt;SetItemState(m_nDropIndex, LVIS_DROPHILITED, LVIS_DROPHILITED);
            // Redraw item
            //pList-&gt;RedrawItems(m_nDropIndex, m_nDropIndex);
            //pList-&gt;UpdateWindow();
        }
        // Lock window updates
        m_pDragImage-&gt;DragShowNolock(TRUE);
	}
	//CListCtrl::OnMouseMove(nFlags, point);
}
</code></pre>
<p>also ich weiß langsam nicht mehr weiter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/392209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/392209</guid><dc:creator><![CDATA[de_Bert]]></dc:creator><pubDate>Wed, 12 Nov 2003 07:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to CImageList Flimmert on Wed, 12 Nov 2003 10:26:27 GMT]]></title><description><![CDATA[<p>OK</p>
<p>thx Leute hat sich erlädigt. Habe das Problem gefunden. Wenn jemand die Lösung haben will einfach mal posten oder mailen</p>
<p>Gruß<br />
de_Bert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/392336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/392336</guid><dc:creator><![CDATA[de_Bert]]></dc:creator><pubDate>Wed, 12 Nov 2003 10:26:27 GMT</pubDate></item></channel></rss>