<?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[Buttonhandle in WndProc]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich bin noch ein ziemlicher noob in Sachen WinAPI aber ich hab da ein Problem für das ich irgendwie keine Lösung finde:</p>
<p>Ich will, dass sich der Text eines Buttons ändert, nachdem ich ihn angeklickt habe.<br />
Dazu fange ich in der WndProc vom parentwindow die BN_CLICKED message ab und öffne von dort eine function, wo ich SetWindowText(hWnd, &quot;TEXT&quot;); sende<br />
...das Problem das ich nun habe ist aber dass ich den Buttonhandle nicht habe und auch nicht weiß wie ich am besten dran komme...ich habe in der msdn schon gelesen dass der handle bei der BN_CLICKED msg als LPARAM übergene wird aber wie wandle ich den dann in ein HWND um? Oder bin ich da komplett auf dem Holzpfad?</p>
<p>Ich hoffe ihr könnt mir helfen ^^&quot; falls diese Frage zuvor schonmal gestellt wurde tut es mir Leid...ich wusste nicht wonach ich hätte suchen sollen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213011/buttonhandle-in-wndproc</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 20:36:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213011.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 May 2008 12:50:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 12:50:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich bin noch ein ziemlicher noob in Sachen WinAPI aber ich hab da ein Problem für das ich irgendwie keine Lösung finde:</p>
<p>Ich will, dass sich der Text eines Buttons ändert, nachdem ich ihn angeklickt habe.<br />
Dazu fange ich in der WndProc vom parentwindow die BN_CLICKED message ab und öffne von dort eine function, wo ich SetWindowText(hWnd, &quot;TEXT&quot;); sende<br />
...das Problem das ich nun habe ist aber dass ich den Buttonhandle nicht habe und auch nicht weiß wie ich am besten dran komme...ich habe in der msdn schon gelesen dass der handle bei der BN_CLICKED msg als LPARAM übergene wird aber wie wandle ich den dann in ein HWND um? Oder bin ich da komplett auf dem Holzpfad?</p>
<p>Ich hoffe ihr könnt mir helfen ^^&quot; falls diese Frage zuvor schonmal gestellt wurde tut es mir Leid...ich wusste nicht wonach ich hätte suchen sollen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508099</guid><dc:creator><![CDATA[Arno Nym]]></dc:creator><pubDate>Tue, 13 May 2008 12:50:49 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 14:57:32 GMT]]></title><description><![CDATA[<p>Das Handle wird von CreateWindowEx zurückgegeben.</p>
<p>Wenn Du den Button in einem Dialog erstellst, wird der Button über ein ID angesprochen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508190</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 13 May 2008 14:57:32 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 15:09:14 GMT]]></title><description><![CDATA[<p>Arno Nym schrieb:</p>
<blockquote>
<p>... aber wie wandle ich den dann in ein HWND um?</p>
</blockquote>
<p>Einfach casten :</p>
<pre><code class="language-cpp">SetWindowText ((HWND)lParam,...);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1508200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508200</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 13 May 2008 15:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 15:27:23 GMT]]></title><description><![CDATA[<p>Ah der cast hats gebracht ^^ wenn ich gewusst hätte dass es so einfach is xDD<br />
Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508224</guid><dc:creator><![CDATA[Arno Nym]]></dc:creator><pubDate>Tue, 13 May 2008 15:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 16:09:10 GMT]]></title><description><![CDATA[<p>merker schrieb:</p>
<blockquote>
<p>Arno Nym schrieb:</p>
<blockquote>
<p>... aber wie wandle ich den dann in ein HWND um?</p>
</blockquote>
<p>Einfach casten :</p>
<pre><code class="language-cpp">SetWindowText ((HWND)lParam,...);
</code></pre>
</blockquote>
<p>is unnötig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508266</guid><dc:creator><![CDATA[haterskater]]></dc:creator><pubDate>Tue, 13 May 2008 16:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 18:38:05 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11581">@Elektronix</a>: Stimmt, aber wenn er mit Dialogen arbeitet (geht aus seinem Post net hervor), wird das nix <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>haterskater schrieb:</p>
<blockquote>
<p>merker schrieb:</p>
<blockquote>
<p>Arno Nym schrieb:</p>
<blockquote>
<p>... aber wie wandle ich den dann in ein HWND um?</p>
</blockquote>
<p>Einfach casten :</p>
<pre><code class="language-cpp">SetWindowText ((HWND)lParam,...);
</code></pre>
</blockquote>
<p>is unnötig.</p>
</blockquote>
<p>Wenn er es so machen will, ist der Cast nicht unnötig!</p>
<p>Alternativ kannst Du aber auch mittels GetDlgItem(hParent, ID_DES_BUTTONS) den Handle ermitteln.</p>
<p>Letzteres ist in Dialogen üblich. Außerdem stehen auch Funktionen wie SetDlgItemText zur Verfügung <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/1508374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508374</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 13 May 2008 18:38:05 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Tue, 13 May 2008 20:18:31 GMT]]></title><description><![CDATA[<p>Ja ich arbeite mit Dialogen ^^<br />
Die Variante mit dem GetDlgItem hatte ich auch versucht allerdings erfolglos weil ich da noch nich wusste dass der Parenthandle ja der WndProc übergeben wird und deswegen konnte ich den Parent auch nich ansprechen xD</p>
<p>jaja ich muss noch einiges dazu lernen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508441</guid><dc:creator><![CDATA[Arno Nym]]></dc:creator><pubDate>Tue, 13 May 2008 20:18:31 GMT</pubDate></item><item><title><![CDATA[Reply to Buttonhandle in WndProc on Wed, 14 May 2008 11:24:35 GMT]]></title><description><![CDATA[<p>CodeFinder schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11581">@Elektronix</a>: Stimmt, aber wenn er mit Dialogen arbeitet (geht aus seinem Post net hervor), wird das nix <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>haterskater schrieb:</p>
<blockquote>
<p>merker schrieb:</p>
<blockquote>
<p>Arno Nym schrieb:</p>
<blockquote>
<p>... aber wie wandle ich den dann in ein HWND um?</p>
</blockquote>
<p>Einfach casten :</p>
<pre><code class="language-cpp">SetWindowText ((HWND)lParam,...);
</code></pre>
</blockquote>
<p>is unnötig.</p>
</blockquote>
<p>Wenn er es so machen will, ist der Cast nicht unnötig!</p>
<p>Alternativ kannst Du aber auch mittels GetDlgItem(hParent, ID_DES_BUTTONS) den Handle ermitteln.</p>
<p>Letzteres ist in Dialogen üblich. Außerdem stehen auch Funktionen wie SetDlgItemText zur Verfügung <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>
</blockquote>
<p>nö is unnötig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508760</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508760</guid><dc:creator><![CDATA[haterskater]]></dc:creator><pubDate>Wed, 14 May 2008 11:24:35 GMT</pubDate></item></channel></rss>