<?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 Icons]]></title><description><![CDATA[<p>Also ich moechte in den einzelnen Items immer ein icon einbinden ( 16 x 16 )</p>
<p>Wenn ich danach google find ich so gut wie nur MFC oder tausend zeiligen komplizierten Code.</p>
<p>Kann mir jemand das in verstaendlichem deutsch und in WINAPI erklaeren ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162627/listview-icons</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 23:34:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162627.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Oct 2006 15:57:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ListView Icons on Fri, 20 Oct 2006 15:57:38 GMT]]></title><description><![CDATA[<p>Also ich moechte in den einzelnen Items immer ein icon einbinden ( 16 x 16 )</p>
<p>Wenn ich danach google find ich so gut wie nur MFC oder tausend zeiligen komplizierten Code.</p>
<p>Kann mir jemand das in verstaendlichem deutsch und in WINAPI erklaeren ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158450</guid><dc:creator><![CDATA[PhoeNix_FasT]]></dc:creator><pubDate>Fri, 20 Oct 2006 15:57:38 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Icons on Sat, 21 Oct 2006 10:02:27 GMT]]></title><description><![CDATA[<p>Hi, vllt hilft dir das:</p>
<p>Das ist ein Ausschnit aus nem größeren Projekt von mir...<br />
Dürfte zu verstehen sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> .</p>
<pre><code class="language-cpp">// Image-List für das Icon:
HIMAGELIST hImgList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),
					GetSystemMetrics(SM_CYSMICON),
					ILC_COLORDDB | ILC_MASK, 1, 0);
HICON hiNoLangsFound;
hiNoLangsFound = LoadIcon(g_hmDllStyle, MAKEINTRESOURCE(ICO_NO_LANG_DLLS_FOUND));
// Icon der Image-List hinzufügen:
int iImgIndex = ImageList_AddIcon(hImgList, hiNoLangsFound);
DestroyIcon(hiNoLangsFound); // &lt;- GDI-Objekt freigeben
ImageList_SetBkColor(hImgList, rgbListViewBkgnd); // &lt;- Hintergrundfarbe des Controls festlegen
ListView_SetImageList(hlsvLanguages, hImgList, LVSIL_SMALL); // &lt;- Image-List zuweisen
PTCHAR pszTemp;
UINT   uiStrLen;
// std::string strReSrc wird hier initialisiert...
uiStrLen = strReSrc.length() + 1;
pszTemp = new TCHAR[uiStrLen]; // &lt;- lokale Stringkopie, wg. const-Return von c_str()-Methode
StrNCpy(pszTemp, strReSrc.c_str(), uiStrLen); 
LVITEM lvItem;
lvItem.mask       = LVIF_IMAGE | LVIF_TEXT;
lvItem.iSubItem   = 0;
lvItem.iItem      = 0;
lvItem.iImage     = iImgIndex;				
lvItem.pszText    = pszTemp;
lvItem.cchTextMax = uiStrLen;
// Item hinzufügen:
SendMessage(hlsvLanguages, LVM_INSERTITEM, 0,
			reinterpret_cast&lt;LPARAM&gt;(&amp;lvItem));
delete [] pszTemp; // &lt;- Speicher deallokieren
</code></pre>
<p>EDIT: Text-Formatierung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158576</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 21 Oct 2006 10:02:27 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Icons on Sat, 21 Oct 2006 12:09:35 GMT]]></title><description><![CDATA[<p>Also ich will sowas aehnliches wie Windows Explorer machen und habe das jetzt</p>
<pre><code class="language-cpp">void GetOwnFiles()
{
	SendMessage(hEdit_OwnDrivers,LVM_DELETEALLITEMS,0,0);
	SendMessage(hEdit_OwnFiles,LVM_DELETEALLITEMS,0,0);
	char szBuffer[1024];
	char filebuffer[MAX_PATH];
	int nLoop = 0;
	SHFILEINFO shInfo;
	WIN32_FIND_DATA wfd;

	LVITEM lvi0, lvi1;

	lvi0.mask = LVIF_TEXT;
	lvi0.iSubItem = 0;
	lvi0.iImage = nLoop;

	lvi1.mask = LVIF_TEXT;
	lvi1.iSubItem = 0;

	GetLogicalDriveStrings(1024, szBuffer);
	char *pch = szBuffer;
	ListView_SetExtendedListViewStyle(hEdit_OwnDrivers,LVS_EX_SUBITEMIMAGES);
	HIMAGELIST g_hImageLst = ImageList_Create(16,16,ILC_MASK | ILC_COLOR32, 5, 0);
	ZeroMemory(&amp;shInfo, sizeof(SHFILEINFO));
	ListView_SetImageList(hEdit_OwnDrivers, g_hImageLst, LVSIL_SMALL);

	while (*pch) 
	{		
		lvi0.iItem = nLoop;
		lvi0.pszText = pch;
		lvi0.iImage = nLoop;

		SHGetFileInfo(pch,FILE_ATTRIBUTE_NORMAL, &amp;shInfo, sizeof(shInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ICON | SHGFI_SMALLICON);	

		ListView_InsertItem(hEdit_OwnDrivers,&amp;lvi0);
		ListView_SetItemText(hEdit_OwnDrivers,lvi0.iItem,0,pch);
		ImageList_AddIcon(g_hImageLst, shInfo.hIcon);

		pch = &amp;pch[strlen(pch) + 1];
		nLoop++;		
	}	

	nLoop = 0;

	ListView_SetExtendedListViewStyle(hEdit_OwnFiles,LVS_EX_SUBITEMIMAGES);
	HIMAGELIST g_hImageLst2 = ImageList_Create(16,16,ILC_MASK | ILC_COLOR32, 5, 5);
	ZeroMemory(&amp;shInfo, sizeof(SHFILEINFO));
	ListView_SetImageList(hEdit_OwnFiles, g_hImageLst2, LVSIL_SMALL);

	HANDLE fHandle=FindFirstFile(Dir,&amp;wfd);
		do
		{
			lvi1.iItem = nLoop;
			if (!( (wfd.cFileName[0]=='.') &amp;&amp; ( (wfd.cFileName[1]=='.' &amp;&amp; wfd.cFileName[2]==0) || wfd.cFileName[1]==0 ) ))
			{
				if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
				{
					sprintf(filebuffer,&quot;%s&quot;,wfd.cFileName);
					lvi1.pszText = filebuffer;

					SHGetFileInfo(0,FILE_ATTRIBUTE_DIRECTORY, &amp;shInfo, sizeof(shInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ICON | SHGFI_SMALLICON);	
					ImageList_AddIcon(g_hImageLst2, shInfo.hIcon);

					ListView_InsertItem(hEdit_OwnFiles,&amp;lvi1);
					ListView_SetItemText(hEdit_OwnFiles,lvi1.iItem,0,lvi1.pszText);
					nLoop ++;

				}
			}
		} while (FindNextFile(fHandle,&amp;wfd));

	FindClose(fHandle); 

	fHandle=FindFirstFile(Dir,&amp;wfd);
		do
		{
			lvi1.iItem = nLoop;
			if (!( (wfd.cFileName[0]=='.') &amp;&amp; ( (wfd.cFileName[1]=='.' &amp;&amp; wfd.cFileName[2]==0) || wfd.cFileName[1]==0 ) ))
			{
				if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
				{

				}
				else
				{
					sprintf(filebuffer,&quot;%s&quot;,wfd.cFileName);
					lvi1.pszText = filebuffer;

					SHGetFileInfo(filebuffer,FILE_ATTRIBUTE_NORMAL, &amp;shInfo, sizeof(shInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ICON | SHGFI_SMALLICON);	
					ImageList_AddIcon(g_hImageLst2, shInfo.hIcon);

					ListView_InsertItem(hEdit_OwnFiles,&amp;lvi1);
					ListView_SetItemText(hEdit_OwnFiles,lvi1.iItem,0,lvi1.pszText);
					nLoop ++;
				}
			}
		} while (FindNextFile(fHandle,&amp;wfd));

	FindClose(fHandle); 
}
</code></pre>
<p>Ich weiss den letzten Teil kann man einfacher machen.<br />
Hier das Ergebnis : <a href="http://img128.imagevenue.com/aAfkjfp01fo1i-25048/loc305/32530_ergebnis_123_305lo.jpg" rel="nofollow">http://img128.imagevenue.com/aAfkjfp01fo1i-25048/loc305/32530_ergebnis_123_305lo.jpg</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158656</guid><dc:creator><![CDATA[PhoeNix_FasT]]></dc:creator><pubDate>Sat, 21 Oct 2006 12:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Icons on Sat, 21 Oct 2006 12:46:51 GMT]]></title><description><![CDATA[<p>lol, Jo Ergebnis:</p>
<p><a href="http://img128.imagevenue.com/aAfkjfp01fo1i-25048/loc305/32530_ergebnis_123_305lo.jpg" rel="nofollow">http://img128.imagevenue.com/aAfkjfp01fo1i-25048/loc305/32530_ergebnis_123_305lo.jpg</a> schrieb:</p>
<blockquote>
<p>Not Found</p>
<p>The requested URL /aAfkjfp01fo1i-25048/loc305/32530_ergebnis_123_305lo.jpg was not found on this server.<br />
Apache/2.0.52 (CentOS) Server at <a href="http://img128.imagevenue.com" rel="nofollow">img128.imagevenue.com</a> Port 80</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1158694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158694</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 21 Oct 2006 12:46:51 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Icons on Sat, 21 Oct 2006 13:41:10 GMT]]></title><description><![CDATA[<p>Um.. naja das Ergebnis ist halt die Liste zeigt alle Dateien / Ordner an jedoch mit nur 1 und dem selben Icon (Ordner icon)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158755</guid><dc:creator><![CDATA[PhoeNix_FasT]]></dc:creator><pubDate>Sat, 21 Oct 2006 13:41:10 GMT</pubDate></item></channel></rss>