<?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[habe problem mit LBN_SELCHANGE, brauche help!]]></title><description><![CDATA[<p>hallo, ich habe hier ne WinAPi mit einer LB in der ich 10Einträge habe( von einer struct ) so nun will ich wenn ich ein string ausgewaehlt habe das der inhalt einer variable in eine editbox geschrieben wird, also so zB. in der Lb steht der Vorname eines players und wenn ich den anklick sprich waehle soll in der editbox der nachname stehen. hier mein versuch der leider net funktioniert:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WindowProc( HWND hWnd, UINT message, WPARAM wParam,
                             LPARAM lParam ) {

    static HWND hListBox;
    static HWND hEdit;
    static int cur;

    static char pTeam[MaxTeamLen];
    static char pColor[MaxColorLen];
    static int pWins;
    static int pLoses;
    static char _pWins;
    static char _pLoses;

    struct Player pTournemant[] = {
                        { &quot;Tobi&quot;, &quot;Knut&quot;, &quot;Blue&quot;, 10, 0 },
                        { &quot;Basti&quot;, &quot;Keule&quot;, &quot;Green&quot;, 1, 5 },
                        { &quot;Uwe&quot;, &quot;Crasher&quot;, &quot;Yellow&quot;, 3, 5 },
                        { &quot;Eric&quot;, &quot;Butcher&quot;, &quot;Pink&quot;, 2, 2 },
                        { &quot;Philipp&quot;, &quot;Killer&quot;, &quot;Black&quot;, 10, 11 },
                        { &quot;Björn&quot;, &quot;Splitter&quot;, &quot;White&quot;, 7, 2 },
                        { &quot;Inge&quot;, &quot;Growler&quot;, &quot;Red&quot;, 9, 6 },
                        { &quot;Klaus&quot;, &quot;Clowns&quot;, &quot;Orange&quot;, 7, 10 },
                        { &quot;Kurt&quot;, &quot;Babys&quot;, &quot;Purple&quot;, 5, 3 },
                        { &quot;Kevin&quot;, &quot;Sanis&quot;, &quot;Gray&quot;, 3, 0 }
                    };

    switch( message ) {

        case WM_CREATE: {

            hEdit = CreateWindow( &quot;EDIT&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_DISABLED,
                                    10, 120, 50, 20, hWnd, (HMENU)2000, hInst, 0 );

            hListBox = CreateWindowEx( WS_EX_CLIENTEDGE,
                                       &quot;LISTBOX&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_VSCROLL,
                                       10, 10, 150, 100, hWnd, (HMENU)ID_ListBox,
                                       hInst, 0 );

            for( int i = 0; i &lt; MaxPlayer; ++i ) {

                SendMessage( hListBox, LB_ADDSTRING, 0,
                             (long)pTournemant[i].playerName );
                SendMessage( hListBox, LB_SETITEMDATA, i, (long)i );
            }
            break;
        }

        case WM_SIZE: {

            break;
        }

        case WM_COMMAND: {

            switch( LOWORD( wParam ) ) {

                case ID_ListBox: {

                    switch( HIWORD( wParam ) ) {

                        case LBN_SELCHANGE: {

                            static int i = 0;
                            cur = SendMessage( hListBox, LB_GETCURSEL, 0, 0 );
                            i = SendMessage( hListBox, LB_GETITEMDATA, cur, 0 );
                            SendMessage( hEdit, WM_SETTEXT, 0,
                                         (long)pTournemant[i].playerTeam );
                            break;
                        }
                    }
                }
                break;
            }
            break;
        }
[...]
</code></pre>
<p>könntet ihr mir hier bei bitte helfen?, danke.</p>
<p>PS: wie stell ich es an das wenn ich eine scrollbar per WS_VSCROLL in die LB integriegre das sie beim eintragen von objecten autom. nach unten scrollt?</p>
<p>gruß Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167673/habe-problem-mit-lbn_selchange-brauche-help</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 14:10:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167673.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Dec 2006 16:07:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 16:07:57 GMT]]></title><description><![CDATA[<p>hallo, ich habe hier ne WinAPi mit einer LB in der ich 10Einträge habe( von einer struct ) so nun will ich wenn ich ein string ausgewaehlt habe das der inhalt einer variable in eine editbox geschrieben wird, also so zB. in der Lb steht der Vorname eines players und wenn ich den anklick sprich waehle soll in der editbox der nachname stehen. hier mein versuch der leider net funktioniert:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WindowProc( HWND hWnd, UINT message, WPARAM wParam,
                             LPARAM lParam ) {

    static HWND hListBox;
    static HWND hEdit;
    static int cur;

    static char pTeam[MaxTeamLen];
    static char pColor[MaxColorLen];
    static int pWins;
    static int pLoses;
    static char _pWins;
    static char _pLoses;

    struct Player pTournemant[] = {
                        { &quot;Tobi&quot;, &quot;Knut&quot;, &quot;Blue&quot;, 10, 0 },
                        { &quot;Basti&quot;, &quot;Keule&quot;, &quot;Green&quot;, 1, 5 },
                        { &quot;Uwe&quot;, &quot;Crasher&quot;, &quot;Yellow&quot;, 3, 5 },
                        { &quot;Eric&quot;, &quot;Butcher&quot;, &quot;Pink&quot;, 2, 2 },
                        { &quot;Philipp&quot;, &quot;Killer&quot;, &quot;Black&quot;, 10, 11 },
                        { &quot;Björn&quot;, &quot;Splitter&quot;, &quot;White&quot;, 7, 2 },
                        { &quot;Inge&quot;, &quot;Growler&quot;, &quot;Red&quot;, 9, 6 },
                        { &quot;Klaus&quot;, &quot;Clowns&quot;, &quot;Orange&quot;, 7, 10 },
                        { &quot;Kurt&quot;, &quot;Babys&quot;, &quot;Purple&quot;, 5, 3 },
                        { &quot;Kevin&quot;, &quot;Sanis&quot;, &quot;Gray&quot;, 3, 0 }
                    };

    switch( message ) {

        case WM_CREATE: {

            hEdit = CreateWindow( &quot;EDIT&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_DISABLED,
                                    10, 120, 50, 20, hWnd, (HMENU)2000, hInst, 0 );

            hListBox = CreateWindowEx( WS_EX_CLIENTEDGE,
                                       &quot;LISTBOX&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_VSCROLL,
                                       10, 10, 150, 100, hWnd, (HMENU)ID_ListBox,
                                       hInst, 0 );

            for( int i = 0; i &lt; MaxPlayer; ++i ) {

                SendMessage( hListBox, LB_ADDSTRING, 0,
                             (long)pTournemant[i].playerName );
                SendMessage( hListBox, LB_SETITEMDATA, i, (long)i );
            }
            break;
        }

        case WM_SIZE: {

            break;
        }

        case WM_COMMAND: {

            switch( LOWORD( wParam ) ) {

                case ID_ListBox: {

                    switch( HIWORD( wParam ) ) {

                        case LBN_SELCHANGE: {

                            static int i = 0;
                            cur = SendMessage( hListBox, LB_GETCURSEL, 0, 0 );
                            i = SendMessage( hListBox, LB_GETITEMDATA, cur, 0 );
                            SendMessage( hEdit, WM_SETTEXT, 0,
                                         (long)pTournemant[i].playerTeam );
                            break;
                        }
                    }
                }
                break;
            }
            break;
        }
[...]
</code></pre>
<p>könntet ihr mir hier bei bitte helfen?, danke.</p>
<p>PS: wie stell ich es an das wenn ich eine scrollbar per WS_VSCROLL in die LB integriegre das sie beim eintragen von objecten autom. nach unten scrollt?</p>
<p>gruß Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191307</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 13 Dec 2006 16:07:57 GMT</pubDate></item><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 16:41:22 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Also nach über 300 Posts solltest Du doch eigentlich wissen, dass das keine ausreichende Fehlerbeschreibung ist, oder ?</p>
<p>T0bi schrieb:</p>
<blockquote>
<p>[...] hier mein versuch der leider net funktioniert: [...]</p>
</blockquote>
<p>Anyway, ... Du musst beim Erstellen deiner ListBox das Flag LBS_NOTIFY setzen, damit das Control die Nachricht überhaupt sendet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191324</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 13 Dec 2006 16:41:22 GMT</pubDate></item><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 16:53:36 GMT]]></title><description><![CDATA[<p>Ups, hab dein PS übersehen, sorry...Voila <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="😉"
    /> : <a href="http://msdn2.microsoft.com/en-us/library/ms671434.aspx" rel="nofollow">LB_SETCARETINDEX</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191331</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 13 Dec 2006 16:53:36 GMT</pubDate></item><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 19:41:02 GMT]]></title><description><![CDATA[<p>oh danke klappt alles wunderbar <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="🙂"
    /> nunja das mit den fehlerbeschreibungen ich werd mich besser, hoff ich^^.<br />
ähm eine frage noch ich habe nun hier eine WINAPI und #include &lt;string&gt; und hab versucht einen string test; zu deklarieren. doch es geht nicht denn es erscheint dei f.meldung:</p>
<pre><code>[C++ Error] api_test2.cpp(22): E2141 Declaration syntax error
</code></pre>
<p>wieso?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191407</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 13 Dec 2006 19:41:02 GMT</pubDate></item><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 20:22:59 GMT]]></title><description><![CDATA[<p>Wie sieht denn Deine Definition des Klassenobjekts aus ?</p>
<p>Poste mal die Zeile, in der der Fehler auftritt. (Hast Du die Fehlermeldung gekürzt ? Was ist n das für n Compiler ?)</p>
<p>Ich tippe mal darauf, das Du den Namensbereich <em>std</em> nicht globalisiert hast:</p>
<pre><code class="language-cpp">using namespace std;
</code></pre>
<p>oder:</p>
<pre><code class="language-cpp">using std::string
</code></pre>
<p>oder:</p>
<pre><code class="language-cpp">std::string strObj(&quot;Ich bin ein String&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1191418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191418</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 13 Dec 2006 20:22:59 GMT</pubDate></item><item><title><![CDATA[Reply to habe problem mit LBN_SELCHANGE, brauche help! on Wed, 13 Dec 2006 20:29:38 GMT]]></title><description><![CDATA[<p>oh sorry, es lag an &quot;using namespace sts;&quot; ich hatte gedacht &quot;#include &lt;string&gt;&quot; würde reichen, wusste nicht das der namespace std; zuzüglich initialisiert werden muss... trotzdem danke :xmas1:</p>
<p>gruß Tobi :xmas2:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191422</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 13 Dec 2006 20:29:38 GMT</pubDate></item></channel></rss>