<?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 Elemente]]></title><description><![CDATA[<p>Ich habe eine ListView mit drei Spalten!<br />
Ich hatte das Problem, dass neu hinzugekommene Elemente immer an erster Stelle hinzugefügt wurden!<br />
Danach habe ich hier im Forum gefunden, dass ich beim ListViewItem 0xFFFFF angeben muss!(LvItem.iItem=0xFFFFF)!<br />
Das funktioniert auch ganz super jedoch besteht das Problem, dass es nur bei der ersten Spalte funktioniert...weiß jemand warum??Wäre sehr dankbar wenn wenn mir jemand helfen würde/könnte!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/212824/listview-elemente</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 20:35:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212824.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 May 2008 20:38:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ListView Elemente on Sat, 10 May 2008 20:38:35 GMT]]></title><description><![CDATA[<p>Ich habe eine ListView mit drei Spalten!<br />
Ich hatte das Problem, dass neu hinzugekommene Elemente immer an erster Stelle hinzugefügt wurden!<br />
Danach habe ich hier im Forum gefunden, dass ich beim ListViewItem 0xFFFFF angeben muss!(LvItem.iItem=0xFFFFF)!<br />
Das funktioniert auch ganz super jedoch besteht das Problem, dass es nur bei der ersten Spalte funktioniert...weiß jemand warum??Wäre sehr dankbar wenn wenn mir jemand helfen würde/könnte!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1506802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1506802</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sat, 10 May 2008 20:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 11:54:22 GMT]]></title><description><![CDATA[<p>Weiß das keiner?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1506956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1506956</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 11:54:22 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 12:18:25 GMT]]></title><description><![CDATA[<p>Dir ist schon klar, dass du immer erst ein neues Listenitem hinzufügen musst, damit du dann ein Item in die dazu gehörigen Spalten schreiben kannst.</p>
<pre><code>+--------+--------+--------+--------+
|Column 1|Column 2|Column 3|Column 4|
+--------+--------+--------+--------+
|Item 0  | Item 1 |        |        |
|Item 0  |        | Item 2 |        |
|Item 0  |        |        | Item 3 |
| ...                               |
+--------+--------+--------+--------+
</code></pre>
<p>Es muss also immer das erste Item hinzugefügt werden.</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1506976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1506976</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 11 May 2008 12:18:25 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 13:58:29 GMT]]></title><description><![CDATA[<p>Mach ich ja eh... Hier der Code:</p>
<pre><code class="language-cpp">LvItem.mask=LVIF_TEXT;   

				LvItem.cchTextMax = 256; /

				LvItem.iItem=0x7FFF;         
				LvItem.iSubItem=0;       

				LvItem.pszText=songTitel; 

				SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&amp;LvItem); // Send info to the Listview

				LvItem.iItem=0x7FFF;

				LvItem.iSubItem=1;

				LvItem.pszText=&quot;Test1&quot;;

				SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem);
				LvItem.iItem=0x7FFF;

				LvItem.iSubItem=2;

				LvItem.pszText=&quot;Test&quot;;
</code></pre>
<p>funktioniert aber nicht!<br />
Die erste Spalte klappt prima, die anderen zwei nciht!</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507031</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 13:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 16:35:13 GMT]]></title><description><![CDATA[<p>Schau mal hier <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="😉"
    /><br />
<a href="http://www.willemer.de/informatik/windows/winlistv.htm#top" rel="nofollow">http://www.willemer.de/informatik/windows/winlistv.htm#top</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507086</guid><dc:creator><![CDATA[RebornX]]></dc:creator><pubDate>Sun, 11 May 2008 16:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 17:11:19 GMT]]></title><description><![CDATA[<p>Hmm irgendwie finde ich nicht die Antwort auf meine Frage</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507096</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 17:11:19 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 17:16:32 GMT]]></title><description><![CDATA[<p>Ich glaube das mit dem 0x7FFF ist Quatsch. Füg doch einfach ein Item für die Zeile hinzu (ist dann in der ersten Spalte) und dann die Subitems für die Spalte. Wenn in der Zeile der Eintrag für die erste Spalte leer sein soll, setz 'nen leeren Text &quot;&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507100</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 11 May 2008 17:16:32 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 18:28:15 GMT]]></title><description><![CDATA[<p>Der erste Eintrag soll nicht leer sein!Die Einträge die neu hinzukommen sollen einfach an der nächstfolgenden Stelle angezeigt werden!<br />
Also:<br />
1Eintrag 1 Position<br />
2Eintrag 2 Position<br />
3Eintrag 3 Position</p>
<p>und nciht das der neu hinzugekommene Eintrag auf die erste Position wandert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507137</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 18:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 18:58:06 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">const char* item_names[3] = { &quot;Item1&quot;, &quot;Item2&quot;, &quot;Item3&quot; };

LvItem.mask = LVIF_TEXT;
LvItem.iSubItem=0;
for ( int i=0; i&lt;3; i++ )
{
    LvItem.iItem = i;
    LvItem.pszText = item_names[i];
    ListView_InsertItem( hList, &amp;LvItem );
}
</code></pre>
<p>bzw:</p>
<pre><code class="language-cpp">void ListView_AddItem( HWND hList, LV_ITEM* item )
{
    item-&gt;iItem = ListView_GetItemCount( hList );
    ListView_InsertItem( hList, item );
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1507149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507149</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 11 May 2008 18:58:06 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 21:26:04 GMT]]></title><description><![CDATA[<p>Das habe ich mir auhc schon überlegt aber bei 100 Einträge ist das eine Mühsame Geshichte..gibt es da keine andere Möglichkeit??<br />
Und was hat das mit dem 0x7FFF an sich??Wieso funktioniert das nur bei der ersten Spalte??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507206</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507206</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 21:26:04 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 21:50:33 GMT]]></title><description><![CDATA[<p>Fragender01 schrieb:</p>
<blockquote>
<p>Das habe ich mir auhc schon überlegt aber bei 100 Einträge ist das eine Mühsame Geshichte..gibt es da keine andere Möglichkeit??</p>
</blockquote>
<p>Wo bitte ist das denn bitte mühsam?</p>
<pre><code class="language-cpp">void ListView_AddItem( HWND hList, LV_ITEM* item )
{
    item-&gt;iItem = ListView_GetItemCount( hList );
    ListView_InsertItem( hList, item );
}
</code></pre>
<p>Oder meinetwegen auch:</p>
<pre><code class="language-cpp">void ListView_AddItems( HWND hList, const std::vector&lt;std::string&gt;&amp; entries )
{
    assert( Header_GetItemCount(ListView_GetHeader(hList)) == entries.size() );
    LVITEM LvItem;
    LvItem.mask = LVIF_TEXT;
    LvItem.iItem = ListView_GetItemCount( hList );
    for ( int i=0; i&lt;entries.size(); i++ )
    {
        LvItem.iSubItem = i;
        LvItem.pszText = entries[i];
        ListView_InsertItem( hList, &amp;LvItem );
    }
}
</code></pre>
<p>Fragender01 schrieb:</p>
<blockquote>
<p>Und was hat das mit dem 0x7FFF an sich??Wieso funktioniert das nur bei der ersten Spalte??</p>
</blockquote>
<p>Keine Ahnung, davon hab ich auch noch nie was gehört.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507217</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 11 May 2008 21:50:33 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 22:35:04 GMT]]></title><description><![CDATA[<p>Ich programmiere in C..<br />
Wäre sehr Hilfreich wenn du den Code auch für C hättest..<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507241</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 22:35:04 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 22:38:14 GMT]]></title><description><![CDATA[<p>Naja, statt std::vector<a href="std::string" rel="nofollow">std::string</a> nimmst du halt const char** als Zeichenketten-Array und noch eine int-Variable o.ä. um die Anzahl der Strings darzustellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507242</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 11 May 2008 22:38:14 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 22:51:38 GMT]]></title><description><![CDATA[<p>Er schreit das er das assert nciht kennt..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507246</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 22:51:38 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Sun, 11 May 2008 23:07:12 GMT]]></title><description><![CDATA[<p>Okey habe es jetzt geschafft!<br />
Thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507250</guid><dc:creator><![CDATA[Fragender01]]></dc:creator><pubDate>Sun, 11 May 2008 23:07:12 GMT</pubDate></item><item><title><![CDATA[Reply to ListView Elemente on Mon, 12 May 2008 20:26:17 GMT]]></title><description><![CDATA[<p>Fragender01 schrieb:</p>
<blockquote>
<p>Das habe ich mir auhc schon überlegt aber bei 100 Einträge ist das eine Mühsame Geshichte..gibt es da keine andere Möglichkeit??<br />
Und was hat das mit dem 0x7FFF an sich??Wieso funktioniert das nur bei der ersten Spalte??</p>
</blockquote>
<p>0x7FFF macht nur bei LVM_INSERTITEM wirklich Sinn, weil es die Einfügeposition angibt. Ist die Einfügeposition kleiner als die Anzahl der Elemente, dann wird an dieser Position angefügt, ansonsten am Ende der Liste. 0x7FFF erspart einem die Ermittlung der aktuellen Elementanzahl, was bei vielen einzufügenden Elementen natürlich auch wertvolle Zeit kostet. Solange man weniger als 32767 Elemente einfügt, kann man getrost 0x7FFF verwenden.</p>
<p>LVM_SETITEM erfordert allerdings die genaue Position des jeweiligen Eintrags, hier ist 0x7FFF völlig fehl am Platz. Deshalb funktioniert das Setzen der Texte für die einzelnen Spalten auch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507735</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Mon, 12 May 2008 20:26:17 GMT</pubDate></item></channel></rss>