<?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[wie bekomme ich das handle für listbox in in der initdlg?]]></title><description><![CDATA[<p>blöde frage, aber ich raffs grad gar nicht mehr. hab ne listbox die ich mit werten füllen möchte. klar mit sendmessage(..) funktioniert aber nur, wenn ich es im case IDC_LIST1 mache, denn wenn ich es in den IntiDialog setze (wo es auch hingehört) habe ich das handle der listbox noch nicht, bzw. weiss nicht genau wie ich da dran komme... hilfe <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>
<pre><code class="language-cpp">LRESULT CALLBACK DlgGazeProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	HWND hwndList;

	switch(uMsg)
	{

	case WM_INITDIALOG:
                               //wie komme ich hier an das handle von idc_list1?
		return TRUE;

	case WM_COMMAND:
		switch(LOWORD (wParam))
		{
		case IDC_LIST1 :
				hwndList = GetDlgItem(hWnd, IDC_LIST1);
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;0&quot;); 
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;1&quot;); 
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;2&quot;); 
		break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/196753/wie-bekomme-ich-das-handle-für-listbox-in-in-der-initdlg</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 01:41:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196753.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Nov 2007 16:07:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Fri, 02 Nov 2007 16:07:02 GMT]]></title><description><![CDATA[<p>blöde frage, aber ich raffs grad gar nicht mehr. hab ne listbox die ich mit werten füllen möchte. klar mit sendmessage(..) funktioniert aber nur, wenn ich es im case IDC_LIST1 mache, denn wenn ich es in den IntiDialog setze (wo es auch hingehört) habe ich das handle der listbox noch nicht, bzw. weiss nicht genau wie ich da dran komme... hilfe <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>
<pre><code class="language-cpp">LRESULT CALLBACK DlgGazeProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	HWND hwndList;

	switch(uMsg)
	{

	case WM_INITDIALOG:
                               //wie komme ich hier an das handle von idc_list1?
		return TRUE;

	case WM_COMMAND:
		switch(LOWORD (wParam))
		{
		case IDC_LIST1 :
				hwndList = GetDlgItem(hWnd, IDC_LIST1);
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;0&quot;); 
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;1&quot;); 
				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) &quot;2&quot;); 
		break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1396499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396499</guid><dc:creator><![CDATA[eugler]]></dc:creator><pubDate>Fri, 02 Nov 2007 16:07:02 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Fri, 02 Nov 2007 16:49:10 GMT]]></title><description><![CDATA[<p>Der Code zum füllem muss in den Abschnitt von WM_INITDIALOG! WENn GetDlgItem NULL zurück gibt, stimmt die ID nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396523</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 02 Nov 2007 16:49:10 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Fri, 02 Nov 2007 17:13:21 GMT]]></title><description><![CDATA[<p>glaub da hast du mich falsch verstanden... :p ich weiss ja, dass des in den initdlg muss, aber wenn ich es dort mache, brauche ich ja das handle von meiner listbox - und eben da liegt mein problem. wie bekomme ich aus dem initdlg heraus das handle meiner listbox? momentan ist es ja so gelöst, dass wenn ich in die listbox klicke auch mein text erschein - allerdings soll der ja beim aufruf des dialogs schon drinstehen.</p>
<p>thnx &amp; greetz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396548</guid><dc:creator><![CDATA[eugler]]></dc:creator><pubDate>Fri, 02 Nov 2007 17:13:21 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Fri, 02 Nov 2007 18:14:00 GMT]]></title><description><![CDATA[<p>Ich habe Dich schon verstanden. Du machst es genauso wie Du es im WM_COMMAND Handler gemacht hast:<br />
hwndList = GetDlgItem(hWnd, IDC_LIST1);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396577</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 02 Nov 2007 18:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Sat, 03 Nov 2007 12:48:42 GMT]]></title><description><![CDATA[<p>geht tatsächlich... als ich es das letze mal dort stehen hatte war das ergebnis, dass nichts in der listbox stand. seeehr seltsam. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /> aber vielen dank!<br />
hast du evtl noch einen tip, wie ich am besten das gewählte element (string) abgreife (kein doppelklick oder so, sondern ok-button) und dann eine aktion durchführe?</p>
<p>greetz &amp; thnx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396959</guid><dc:creator><![CDATA[eugler]]></dc:creator><pubDate>Sat, 03 Nov 2007 12:48:42 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Sat, 03 Nov 2007 13:31:55 GMT]]></title><description><![CDATA[<p>LB_GETCURSEL...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396991</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 03 Nov 2007 13:31:55 GMT</pubDate></item><item><title><![CDATA[Reply to wie bekomme ich das handle für listbox in in der initdlg? on Sat, 03 Nov 2007 14:20:52 GMT]]></title><description><![CDATA[<p>so in der art? klappt leider nicht ganz, denn nSelect kriegt immer den wert -1 zugewiesen. eine idee warum?</p>
<p>nSelect = (int)SendDlgItemMessage(hWnd, IDC_LIST1, LB_GETCURSEL, 0, 0);</p>
<p>greetz &amp; thnx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1397010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1397010</guid><dc:creator><![CDATA[eugler]]></dc:creator><pubDate>Sat, 03 Nov 2007 14:20:52 GMT</pubDate></item></channel></rss>