<?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[&#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig]]></title><description><![CDATA[<p>Hi,</p>
<p>ich nehem mal an die meisten von euch sind im Besitz der &quot;Win32API Programers Reference&quot;.<br />
Da ist ja ein Beispiel zum hinzufügen eines Items zu einem &quot;Treeview Control&quot;.<br />
Aber wenn ich da mehrere in einander verschachteln will, mit Hilfe der Variable 'nLevel', funktioniert das nicht korreckt.<br />
kann mir jemand sagen warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191192/treeview-control-item-hinzufügen-funktioniert-nicht-richtig</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 13:38:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191192.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 31 Aug 2007 09:09:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Fri, 31 Aug 2007 09:09:54 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich nehem mal an die meisten von euch sind im Besitz der &quot;Win32API Programers Reference&quot;.<br />
Da ist ja ein Beispiel zum hinzufügen eines Items zu einem &quot;Treeview Control&quot;.<br />
Aber wenn ich da mehrere in einander verschachteln will, mit Hilfe der Variable 'nLevel', funktioniert das nicht korreckt.<br />
kann mir jemand sagen warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1355887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1355887</guid><dc:creator><![CDATA[LukasBanana]]></dc:creator><pubDate>Fri, 31 Aug 2007 09:09:54 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Fri, 31 Aug 2007 09:16:53 GMT]]></title><description><![CDATA[<p>Ich bin nicht im Besitz der &quot;Win32API Programers Reference&quot;.</p>
<p>-----------------<br />
tenchou ‾ω‾</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1355895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1355895</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Fri, 31 Aug 2007 09:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Fri, 31 Aug 2007 10:40:01 GMT]]></title><description><![CDATA[<p>Was meinst Du mit nLevel? Zeig uns mal Code wie Du Einträge hinzufügst. Normalerweise gibst Du einfach den Parent Knoten an und fügst einen neuen ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1355951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1355951</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 31 Aug 2007 10:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Fri, 31 Aug 2007 15:08:54 GMT]]></title><description><![CDATA[<p>Das ist der Beispiel Code aus der <em>Win32API Programers Reference</em></p>
<pre><code class="language-cpp">HTREEITEM AddItemToTree(HWND hwndTV, LPSTR lpszItem, int nLevel) 

{ 
    TV_ITEM tvi; 
    TV_INSERTSTRUCT tvins; 
    static HTREEITEM hPrev = (HTREEITEM) TVI_FIRST; 
    static HTREEITEM hPrevRootItem = NULL; 
    static HTREEITEM hPrevLev2Item = NULL; 
    HTREEITEM hti; 

    tvi.mask = TVIF_TEXT | TVIF_IMAGE 
        | TVIF_SELECTEDIMAGE | TVIF_PARAM; 

    // Set the text of the item. 
    tvi.pszText = lpszItem; 
    tvi.cchTextMax = lstrlen(lpszItem); 

    // Assume the item is not a parent item, so give it a 

    // document image. 
    tvi.iImage = g_nDocument; 
    tvi.iSelectedImage = g_nDocument; 

    // Save the heading level in the item's application-defined 
    // data area. 
    tvi.lParam = (LPARAM) nLevel; 

    tvins.item = tvi; 
    tvins.hInsertAfter = hPrev; 

    // Set the parent item based on the specified level. 
    if (nLevel == 1) 
        tvins.hParent = TVI_ROOT; 
    else if (nLevel == 2) 
        tvins.hParent = hPrevRootItem; 
    else 

        tvins.hParent = hPrevLev2Item; 

    // Add the item to the tree-view control. 
    hPrev = (HTREEITEM) SendMessage(hwndTV, TVM_INSERTITEM, 0, 
         (LPARAM) (LPTV_INSERTSTRUCT) &amp;tvins); 

    // Save the handle of the item. 
    if (nLevel == 1) 
        hPrevRootItem = hPrev; 
    else if (nLevel == 2) 
        hPrevLev2Item = hPrev; 

    // The new item is a child item. Give the parent item a 
    // closed folder bitmap to indicate it now has child items. 

    if (nLevel &gt; 1) { 
        hti = TreeView_GetParent(hwndTV, hPrev); 
        tvi.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; 
        tvi.hItem = hti; 
        tvi.iImage = g_nClosed; 
        tvi.iSelectedImage = g_nClosed; 
        TreeView_SetItem(hwndTV, &amp;tvi); 
    } 

    return hPrev; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1356178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1356178</guid><dc:creator><![CDATA[LukasBanana]]></dc:creator><pubDate>Fri, 31 Aug 2007 15:08:54 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Mon, 03 Sep 2007 06:00:11 GMT]]></title><description><![CDATA[<p>Ich sehe hier kein Problem. Außer das dieser Stil mit den statischen Variablen eine Katastrophe ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357570</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 03 Sep 2007 06:00:11 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;Treeview Control Item hinzufügen&#x27; funktioniert nicht richtig on Mon, 03 Sep 2007 15:47:44 GMT]]></title><description><![CDATA[<p>Nagut, das ist ja auch nur ein Beispiel von Microsoft, aber ich werd`s noch mal probieren,<br />
Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358082</guid><dc:creator><![CDATA[LukasBanana]]></dc:creator><pubDate>Mon, 03 Sep 2007 15:47:44 GMT</pubDate></item></channel></rss>