<?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[LISTVIEW CONTROL mit ICONEN]]></title><description><![CDATA[<p>Ich möchte einen Listview Control mit Symbole und Text erstellen, könnte mir jemand einen funktionierenden Beispiel zeigen?</p>
<p>Ich probiere es schon zum zweiten mal, abber irgendwas klappt nie...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133282/listview-control-mit-iconen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 17:27:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133282.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Jan 2006 15:46:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LISTVIEW CONTROL mit ICONEN on Mon, 16 Jan 2006 15:46:21 GMT]]></title><description><![CDATA[<p>Ich möchte einen Listview Control mit Symbole und Text erstellen, könnte mir jemand einen funktionierenden Beispiel zeigen?</p>
<p>Ich probiere es schon zum zweiten mal, abber irgendwas klappt nie...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968176</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Mon, 16 Jan 2006 15:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to LISTVIEW CONTROL mit ICONEN on Mon, 16 Jan 2006 15:54:47 GMT]]></title><description><![CDATA[<p>Hier,</p>
<p>snippsel Dir raus was Du brauchst ...</p>
<pre><code class="language-cpp">void refresh_user_tree(HWND hTree, CMessage msg)
{
	#define CX_ICON	20
	#define CY_ICON	20
	#define NUM_ICONS	2

	HIMAGELIST himlIcons;  // handle to new image list 
    HICON hicon;           // handle to icon 

	TVINSERTSTRUCT is;
	string strBeg, strEnd, strUser;
	int nPos, nBeg, nEnd;
	nPos = nBeg = nEnd = 0;
	strBeg = &quot;&lt;u&gt;&quot;;
	strEnd = &quot;&lt;/u&gt;&quot;;

	TreeView_SetImageList(hTree, NULL, TVSIL_NORMAL);

	himlIcons = ImageList_Create(CX_ICON, CY_ICON, ILC_MASK, NUM_ICONS, 0); 

	hicon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_OFFLINE)); 
	ImageList_AddIcon(himlIcons, hicon);

	hicon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ONLINE));
    ImageList_AddIcon(himlIcons, hicon);

	TreeView_SetImageList(hTree, himlIcons, TVSIL_NORMAL);

	TreeView_DeleteItem(hTree, TVI_ROOT);
	while((nBeg=msg.m_str_Msg.find(strBeg.c_str(),nPos)) &gt; -1)
	{
		if( nBeg &gt; 0 &amp;&amp; nPos == nBeg ) 
			break;

		nBeg += strBeg.length();
		nEnd=msg.m_str_Msg.find(strEnd, nBeg);
		if( nEnd == -1 || nEnd == nBeg ) 
			break;

		strUser = msg.m_str_Msg.substr(nBeg, nEnd-nBeg);
		nPos = strUser.find_last_of('@');
		if( nPos &gt; 0 )
		{
			string strOnline = strUser.substr(nPos+1);
			strUser = strUser.substr(0, nPos);

			memset(&amp;is, 0, sizeof(is));

			if( strOnline[0] == '0' ) 
			{
				strUser += &quot;:offline&quot;;
				is.itemex.iImage = 0;
			}
			if( strOnline[0] == '1' ) 
			{
				strUser += &quot;:online&quot;;
				is.itemex.iImage = 1;
			}
			is.hParent = TVI_ROOT;
			is.hInsertAfter = TVI_LAST;
			is.itemex.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
			is.itemex.hItem;
			is.itemex.state;
			is.itemex.stateMask;
			is.itemex.pszText = (char*)strUser.c_str();
			is.itemex.cchTextMax = strUser.length();
			//is.itemex.iImage;
			is.itemex.iSelectedImage = is.itemex.iImage;
			is.itemex.cChildren;
			is.itemex.lParam;
			is.itemex.iIntegral;
			TreeView_InsertItem(hTree, &amp;is);
		}
		nPos = nBeg;
	}
}
</code></pre>
<p>Viel Erfolg.<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968188</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Mon, 16 Jan 2006 15:54:47 GMT</pubDate></item><item><title><![CDATA[Reply to LISTVIEW CONTROL mit ICONEN on Mon, 16 Jan 2006 15:57:39 GMT]]></title><description><![CDATA[<p>Klasse! So schnell wurde mir noch auf keinem Forum antwortet! Danke sehr!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968190</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Mon, 16 Jan 2006 15:57:39 GMT</pubDate></item></channel></rss>