<?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 Frage]]></title><description><![CDATA[<p>Hallo Zusammen,<br />
hätte zwei Fragen zu einer Listbox.<br />
1. Ich füge Daten mittels SendMessage(hwnd,LB_ADDSTRING,0,(long)&quot;TEXT&quot;); ein. Was muss ich machen, dass die Liste bei neuen Einträgen automatisch nach unten scrollt?<br />
2.Kann ich den Textstil in der Listbox irgendwie verrändern?</p>
<p>Gruß mr.tompkins</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177166/listbox-frage</link><generator>RSS for Node</generator><lastBuildDate>Sat, 27 Jun 2026 01:29:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177166.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Mar 2007 17:38:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Listbox Frage on Wed, 28 Mar 2007 17:38:32 GMT]]></title><description><![CDATA[<p>Hallo Zusammen,<br />
hätte zwei Fragen zu einer Listbox.<br />
1. Ich füge Daten mittels SendMessage(hwnd,LB_ADDSTRING,0,(long)&quot;TEXT&quot;); ein. Was muss ich machen, dass die Liste bei neuen Einträgen automatisch nach unten scrollt?<br />
2.Kann ich den Textstil in der Listbox irgendwie verrändern?</p>
<p>Gruß mr.tompkins</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254870</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254870</guid><dc:creator><![CDATA[mr. tompkins]]></dc:creator><pubDate>Wed, 28 Mar 2007 17:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Wed, 28 Mar 2007 18:20:45 GMT]]></title><description><![CDATA[<p>ich glaube du musst bei der erstellung der LB beim style noch das flag<br />
WS_VSCROLL setzen.</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254903</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 28 Mar 2007 18:20:45 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Wed, 28 Mar 2007 18:32:39 GMT]]></title><description><![CDATA[<p>ach ja noch was weiss auch net so wirklich obs funktioniert, aber des mit deiner schrift die du aendern willst könnte so geregelt werden:</p>
<p>erst erstellst du dir eine schrift mit:</p>
<pre><code class="language-cpp">HFONT CreateFont(

    int nHeight,	// logical height of font 
    int nWidth,	// logical average character width 
    int nEscapement,	// angle of escapement 
    int nOrientation,	// base-line orientation angle 
    int fnWeight,	// font weight 
    DWORD fdwItalic,	// italic attribute flag 
    DWORD fdwUnderline,	// underline attribute flag 
    DWORD fdwStrikeOut,	// strikeout attribute flag 
    DWORD fdwCharSet,	// character set identifier 
    DWORD fdwOutputPrecision,	// output precision 
    DWORD fdwClipPrecision,	// clipping precision 
    DWORD fdwQuality,	// output quality 
    DWORD fdwPitchAndFamily,	// pitch and family 
    LPCTSTR lpszFace 	// pointer to typeface name string 
   );
</code></pre>
<p>und dann setzt du des Handle von HFONT hier ein:</p>
<pre><code class="language-cpp">SendMessage( BUTTON_HWND, WM_SETFONT, (WPARAM) hFont, 0 );
</code></pre>
<p>probiers einfach mal aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254915</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 28 Mar 2007 18:32:39 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Thu, 29 Mar 2007 09:01:48 GMT]]></title><description><![CDATA[<p>Super hat funktioniert.<br />
Hast Du noch eine Idee wie ich einen Edit Control bearbeiten müsste, dass er bei betätigen der Enter-Taste einen bestimmten Befehl ausführt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255156</guid><dc:creator><![CDATA[mr. tompkins]]></dc:creator><pubDate>Thu, 29 Mar 2007 09:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Thu, 29 Mar 2007 09:22:44 GMT]]></title><description><![CDATA[<p>Ich glaube das bekommst du nur mittels Subclasing hin. Guck mal auf <a href="http://www.winapi.net" rel="nofollow">www.winapi.net</a> da ist ein schönes einfach beispiel. Vielleicht gehts aber auch noch leichter?</p>
<p>MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255166</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Thu, 29 Mar 2007 09:22:44 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Thu, 29 Mar 2007 13:10:45 GMT]]></title><description><![CDATA[<p>könnte man des nicht auch mit dem eingabefocus arbeiten? also abfrage ob das jeweilige Editfeld gerade den eingabefocus hat und wenn Enter gedrueckt wurde, also mit ner abfrage if( LOWORD( wParam ) == VK_RETURN ), gepusht wurde... dann die anweisung geben etwas zu machen. könnte evtl funktionieren:)</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255326</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Thu, 29 Mar 2007 13:10:45 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Fri, 30 Mar 2007 17:48:45 GMT]]></title><description><![CDATA[<p>Habe Folgendes versucht :<br />
[cpp]<br />
hwndLC = CreateWindowEx(WS_EX_CLIENTEDGE,&quot;EDIT&quot;, 0,WS_CHILD|WS_BORDER|WS_VISIBLE,<br />
35, 250, 320, 25, hwnd, (HMENU)ID_ENTER, hInstance, NULL);</p>
<p>...</p>
<p>case WM_COMMAND:<br />
...<br />
case ID_ENTER:<br />
if(LOWORD(lParam)==VK_RETURN)...<br />
[cpp]<br />
hat aber nicht funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1256215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256215</guid><dc:creator><![CDATA[mr. tompkins]]></dc:creator><pubDate>Fri, 30 Mar 2007 17:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Fri, 30 Mar 2007 18:06:14 GMT]]></title><description><![CDATA[<p>mr. tompkins schrieb:</p>
<blockquote>
<p>1. Ich füge Daten mittels SendMessage(hwnd,LB_ADDSTRING,0,(long)&quot;TEXT&quot;); ein.</p>
</blockquote>
<p>Keine Gute Idee. Das _kann_ (UNICODE/ANSI) in die Hose gehen. Machs besser so:</p>
<pre><code class="language-cpp">SendMessage(hwnd, LB_ADDSTRING, 0, reinterpret_cast&lt;LPARAM&gt;(TEXT(&quot;TEXT&quot;)));
</code></pre>
<p>mr. tompkins schrieb:</p>
<blockquote>
<p>Was muss ich machen, dass die Liste bei neuen Einträgen automatisch nach unten scrollt?</p>
</blockquote>
<p>Zum Scrollen musst Du, wie T0bi schon gesagt hat, das Style WS_VSCROLL bzw. WS_HSCROLL angeben.</p>
<p>mr. tompkins schrieb:</p>
<blockquote>
<p>2.Kann ich den Textstil in der Listbox irgendwie verrändern?</p>
</blockquote>
<p>Joar versuchs mal mit WM_SETFONT, falls das nix wird, dann einfach mal einen Message-Handler für <a href="http://msdn2.microsoft.com/en-us/library/ms671447.aspx" rel="nofollow">WM_CTLCOLORLISTBOX</a> schreiben und die Schrift im HDC ändern (lParam).<br />
Eine (mir besser gefallende) Alternative zu <em>CreateFont</em> ist <em>CreateFontIndirect</em> mit einem Objekt der Struktur <em>LOGFONT</em>. Geht aber beides <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>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12675">@T0bi</a> bzw. mr. tompkins:</p>
<p>T0bi schrieb:</p>
<blockquote>
<p>könnte man des nicht auch mit dem eingabefocus arbeiten? also abfrage ob das jeweilige Editfeld gerade den eingabefocus hat und wenn Enter gedrueckt wurde, also mit ner abfrage if( LOWORD( wParam ) == VK_RETURN ), gepusht wurde... dann die anweisung geben etwas zu machen. könnte evtl funktionieren:)</p>
</blockquote>
<p>Nein das wird nicht funktionieren, da Du bei dieser Nachricht keinen Virtual-Key-Code bekommst. Da musst Du unweigerlich Subclas<strong>s</strong>en.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1256228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256228</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Fri, 30 Mar 2007 18:06:14 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Frage on Fri, 30 Mar 2007 19:37:53 GMT]]></title><description><![CDATA[<p>mr. tompkins schrieb:</p>
<blockquote>
<p>2.Kann ich den Textstil in der Listbox irgendwie verrändern?</p>
</blockquote>
<p>Dafür habe ich mal ne kleine Klasse geschrieben. Siehe <a href="http://www.webfritzi.de.vu" rel="nofollow">www.webfritzi.de.vu</a> in der WinAPI-Ecke unter &quot;Klassen&quot;. Einfach so:</p>
<pre><code class="language-cpp">CFont* lpFont = new CFont( TEXT(&quot;Times New Roman&quot;), 10, FS_BOLD );
SendMessage( hListBox, WM_SETFONT, lpFont-&gt;GetHandle(), MAKELPARAM(TRUE, 0) );
...
delete lpFont;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1256271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256271</guid><dc:creator><![CDATA[WebFritzi]]></dc:creator><pubDate>Fri, 30 Mar 2007 19:37:53 GMT</pubDate></item></channel></rss>