<?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[Listbox problem]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe in einer dialogresource eine Listbox, habe auch das häkchen bei Benachrichtigung gesetzt.<br />
Aber ich empfange keine Nachrichten, wenn ich die Auswahl bei der Box ändere:</p>
<pre><code class="language-cpp">INT CALLBACK TileDataProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	char c[64];
	int i = 0;

	switch(Msg)
	{
	case WM_INITDIALOG:
		if(!MapInit)
		{
			MSG_ERROR(&quot;Es ist keine Karte geladen!&quot;);
			EndDialog(hWnd, 1);
			return 0;
		}

		// Alle Tiles auflisten
		for(i = 0; i &lt; g_Map-&gt;GetNumTiles(0); i++)
		{
			sprintf(c, &quot;Tile %d&quot;, i);
			SendDlgItemMessage(hWnd, IDC_TILELIST, LB_ADDSTRING, 0, (long)c);
		}

		break;

	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDC_OK:
			EndDialog(hWnd, 0);
			break;

		case IDC_CANCEL:
			EndDialog(hWnd, 1);
			break;

		case LBN_SELCANCEL:
		case LBN_DBLCLK:
		case LBN_SELCHANGE:
			MSG_INFO(&quot;selchange!&quot;);  // Weder hier kommt ne MessageBox
			break;	
		default:

			return DefWindowProc(hWnd, Msg, wParam, lParam);
		}
		break;

	case LBN_SELCANCEL:
	case LBN_DBLCLK:
	case LBN_SELCHANGE:
		MSG_INFO(&quot;selchange!&quot;);  // noch hier...
		break;	

	default:
		return DefWindowProc(hWnd, Msg, wParam, lParam);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/66559/listbox-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 19:21:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/66559.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Feb 2004 17:24:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Listbox problem on Sun, 29 Feb 2004 17:25:21 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe in einer dialogresource eine Listbox, habe auch das häkchen bei Benachrichtigung gesetzt.<br />
Aber ich empfange keine Nachrichten, wenn ich die Auswahl bei der Box ändere:</p>
<pre><code class="language-cpp">INT CALLBACK TileDataProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	char c[64];
	int i = 0;

	switch(Msg)
	{
	case WM_INITDIALOG:
		if(!MapInit)
		{
			MSG_ERROR(&quot;Es ist keine Karte geladen!&quot;);
			EndDialog(hWnd, 1);
			return 0;
		}

		// Alle Tiles auflisten
		for(i = 0; i &lt; g_Map-&gt;GetNumTiles(0); i++)
		{
			sprintf(c, &quot;Tile %d&quot;, i);
			SendDlgItemMessage(hWnd, IDC_TILELIST, LB_ADDSTRING, 0, (long)c);
		}

		break;

	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDC_OK:
			EndDialog(hWnd, 0);
			break;

		case IDC_CANCEL:
			EndDialog(hWnd, 1);
			break;

		case LBN_SELCANCEL:
		case LBN_DBLCLK:
		case LBN_SELCHANGE:
			MSG_INFO(&quot;selchange!&quot;);  // Weder hier kommt ne MessageBox
			break;	
		default:

			return DefWindowProc(hWnd, Msg, wParam, lParam);
		}
		break;

	case LBN_SELCANCEL:
	case LBN_DBLCLK:
	case LBN_SELCHANGE:
		MSG_INFO(&quot;selchange!&quot;);  // noch hier...
		break;	

	default:
		return DefWindowProc(hWnd, Msg, wParam, lParam);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/470228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/470228</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sun, 29 Feb 2004 17:25:21 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox problem on Sun, 29 Feb 2004 17:46:57 GMT]]></title><description><![CDATA[<p>Die Message kommt als WM_COMMAND, allerding ist im LOWORD(wParam) der ListBox-Identifier!</p>
<p>ALso mut Du case IDC_LIST1 (oder wie auch immer Deine Listbox heißt) innerhalb WM_COMMAND abfangen!</p>
<p>Dann kannst Du per switch(HIWORD(wParam)) die Message abfangen (z. B. LBN_SELCANCEL)...</p>
<p>Siehe auch <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listboxes/listboxreference/listboxmessages/lbn_selcancel.asp" rel="nofollow">MSDN: LBN_SELCANCEL</a>.</p>
<p>In Deinem Beispiel wäre das also so:</p>
<pre><code class="language-cpp">INT CALLBACK TileDataProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) 
{ 
    char c[64]; 
    int i = 0; 

    switch(Msg) 
    { 
    case WM_INITDIALOG: 
        if(!MapInit) 
        { 
            MSG_ERROR(&quot;Es ist keine Karte geladen!&quot;); 
            EndDialog(hWnd, 1); 
            return 0; 
        } 

        // Alle Tiles auflisten 
        for(i = 0; i &lt; g_Map-&gt;GetNumTiles(0); i++) 
        { 
            sprintf(c, &quot;Tile %d&quot;, i); 
            SendDlgItemMessage(hWnd, IDC_TILELIST, LB_ADDSTRING, 0, (long)c); 
        } 

        break; 

    case WM_COMMAND: 
        switch(LOWORD(wParam)) 
        { 
        case IDC_OK: 
            EndDialog(hWnd, 0); 
            break; 

        case IDC_CANCEL: 
            EndDialog(hWnd, 1); 
            break; 

        case IDC_LIST1:
            switch(HIWORD(wParam)
            {
            case LBN_SELCANCEL: 
                MSG_INFO(&quot;LBN_SELCANCEL!&quot;);
                break;

            case LBN_DBLCLK: 
                MSG_INFO(&quot;LBN_DBLCLK!&quot;);
                break;

            case LBN_SELCHANGE: 
                MSG_INFO(&quot;LBN_SELCHANGE!&quot;);
                break;    
            }
            break;

        default: 
            return DefWindowProc(hWnd, Msg, wParam, lParam); 
        } 
        break; 

    default: 
        return DefWindowProc(hWnd, Msg, wParam, lParam); 
    } 
    return 0; 
}
</code></pre>
<p>Anstatt INT CALLBACK TileDataProc solltest Du lieber beim Standard BOOL CALLBACK TileDataProc bleiben und statt &quot;return 0;&quot; lieber &quot;return TRUE;&quot; zurückgeben, wenn Du die Message bearbeitet hast, ansonsten &quot;return FALSE;&quot;!</p>
<p>Es kann sonst zu seltsamen Verhalten deines Dialoges führen, da Windows (bzw. der DialogManager) TRUE erwartet, wenn die Nachricht bearbeitet wurde...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/470238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/470238</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Sun, 29 Feb 2004 17:46:57 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox problem on Fri, 01 Feb 2008 12:48:25 GMT]]></title><description><![CDATA[<p>Schon 4 Jahre ist dass hier her,<br />
und auch heut fällt ein anfang schwer.</p>
<p>Hey @ll.</p>
<p>Ich habe einen Interessanten Fehler.</p>
<p>Ich habe quasi den von Hepi geposteten Code</p>
<p>WM_COMMAND-&gt;(LOWORD)LISTBOX-&gt;(HIGHWORD)LBN_SELCHANGE<br />
und es Funktioniert nicht.</p>
<p>Ich bin sehr verwundert...</p>
<p>hier mein Code:</p>
<pre><code class="language-cpp">#define false 		FALSE
#define true 		TRUE
#define bool		BOOL
#define limFormat 	5

HWND liFormat;

LRESULT CALLBACK WndProc( HWND targetWnd, UINT wndMsg, WPARAM wParam, LPARAM lParam )
{
    bool visitMsg = false;
    int liSel;
	switch( wndMsg )
	{
        case WM_CREATE:
            liFormat = CreateWindow( &quot;LISTBOX&quot;, &quot;Formatliste&quot;, LBS_NOTIFY | WS_CHILD | WS_DLGFRAME,
            235, 15, 100, 110, targetWnd, (HMENU)limFormat, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL );
        break;
		case WM_COMMAND:
			switch( LOWORD(wParam) )
			{
				case limFormat:
					switch( HIWORD(wParam) )
					{
						case LBN_SELCHANGE:
							printf( &quot;selection: &quot; );
							liSel = (int)SendMessage( liFormat, LB_GETCURSEL, 0, 0 );
							printf( &quot;%d\n&quot;, liSel );
							setFormat( liSel );//nebensache( setzt Format von RichEdit)
						break;
					}
					hideAll();  //versteckt dieses Fenster
				break;
			}
		break;
	}
	if( !visitMsg )
		return DefWindowProc( targetWnd, wndMsg, wParam, lParam );

	return 0;
}
</code></pre>
<p>EDIT: einen default unter SELCHANGE würde ich übrigens bekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1447549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1447549</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Fri, 01 Feb 2008 12:48:25 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox problem on Mon, 04 Feb 2008 07:08:52 GMT]]></title><description><![CDATA[<p>Kann mir da keiner wwas zu sagen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1448854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1448854</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 04 Feb 2008 07:08:52 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox problem on Mon, 04 Feb 2008 08:01:03 GMT]]></title><description><![CDATA[<p>[war Quatsch]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1448862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1448862</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 04 Feb 2008 08:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox problem on Mon, 04 Feb 2008 10:02:40 GMT]]></title><description><![CDATA[<p>Problem hat sich selbst gelöst...</p>
<p>Fehler unbekannt.</p>
<p>Habe lediglich die hideAll() funktion in Zeile 29 verschoben....</p>
<p>Vielleicht liegt es daran das Zeit zum bearbeiten gebraucht wwurde oder so...</p>
<p>Danke trotzdem... <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/1448917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1448917</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 04 Feb 2008 10:02:40 GMT</pubDate></item></channel></rss>