<?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[ButtonProcedure?]]></title><description><![CDATA[<p>Hi, ich wollte mal Fragen, ob es sowas wie eine ButtonProcedure gibt (so wie eine WindowProcedure, eben nur für den Button). Ich habe nämlich das Problem, dass ich Buttons abfragen will, ob die Maus auf dem jeweiligen Button ist. Wie kann ich das machen? Natürlich nicht MFC und so einfach wie möglich. Das eine Beispiel auf CodeProjects ist 500 Zeilen groß. Wozu?! Ich brauch dafür sicher weniger als 250 Zeilen (alles in einem außer die Button-Abfrage ist 183 Zeilen groß ;)).</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/209209/buttonprocedure</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 12:16:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/209209.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Mar 2008 20:53:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 20:53:53 GMT]]></title><description><![CDATA[<p>Hi, ich wollte mal Fragen, ob es sowas wie eine ButtonProcedure gibt (so wie eine WindowProcedure, eben nur für den Button). Ich habe nämlich das Problem, dass ich Buttons abfragen will, ob die Maus auf dem jeweiligen Button ist. Wie kann ich das machen? Natürlich nicht MFC und so einfach wie möglich. Das eine Beispiel auf CodeProjects ist 500 Zeilen groß. Wozu?! Ich brauch dafür sicher weniger als 250 Zeilen (alles in einem außer die Button-Abfrage ist 183 Zeilen groß ;)).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1481734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481734</guid><dc:creator><![CDATA[Nolf]]></dc:creator><pubDate>Thu, 27 Mar 2008 20:53:53 GMT</pubDate></item><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 20:57:06 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Subclassing</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1481737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481737</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Thu, 27 Mar 2008 20:57:06 GMT</pubDate></item><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 20:57:59 GMT]]></title><description><![CDATA[<p>Button Procedure mit GetWindowLong holen und auf WM_MOUSEMOVE lauschen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1481738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481738</guid><dc:creator><![CDATA[Olympisches_Spiel]]></dc:creator><pubDate>Thu, 27 Mar 2008 20:57:59 GMT</pubDate></item><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 21:49:15 GMT]]></title><description><![CDATA[<p>OK ich hab den Sinn verstanden, aber so ganz haut es dann doch nicht hin. Muss ich eine Variable (LONG) anlegen und dann dies schreiben?</p>
<pre><code class="language-cpp">ButtonProcedure = GetWindowLong(hButton, GWL_WNDPROC);
</code></pre>
<p>Problem: ButtonProcedure ist eine Funktion und deswegen ist das hier schonmal nicht möglich. So würde ich die Procedure dann schreiben:<br />
(Ohne switch und case, würde nur Platz verschwenden)</p>
<pre><code class="language-cpp">LRESULT CALLBACK ButtonProcedure(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	if(msg == WM_MOUSEMOVE)
		bOnButton = true;
	else
		return DefWindowProc(hwnd, msg, wParam, lParam);

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1481761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481761</guid><dc:creator><![CDATA[Nolf]]></dc:creator><pubDate>Thu, 27 Mar 2008 21:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 21:57:51 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">WNDPROC OldWndProc = (WNDPROC) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) NewWndProc);

LRESULT APIENTRY NewWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
    if(msg == WM_MOUSEMOVE)
        bOnButton = true;
    else
        return CallWindowProc(OldWndProc, hWnd, uMsg, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1481765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481765</guid><dc:creator><![CDATA[Olympisches_Spiel]]></dc:creator><pubDate>Thu, 27 Mar 2008 21:57:51 GMT</pubDate></item><item><title><![CDATA[Reply to ButtonProcedure? on Thu, 27 Mar 2008 22:02:56 GMT]]></title><description><![CDATA[<p>Ah super ich habs verstanden! Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1481766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1481766</guid><dc:creator><![CDATA[Nolf]]></dc:creator><pubDate>Thu, 27 Mar 2008 22:02:56 GMT</pubDate></item></channel></rss>