<?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[Abfangen von Wm_Messages]]></title><description><![CDATA[<p>Erneute Anfrage:</p>
<p>Ich habe mal vor kurzem die Frage gestellt, ob es geht MouseEvents... abzufangen.</p>
<p>Dabei kam die Antwort: Hooks könnten diese abfangen.<br />
Nur, wie realisiert man Hooks.</p>
<p>Mein Problem:</p>
<p>Einfache Aufgabe.<br />
Es soll über die Messages Mouse Move,ButtonUp,Button Down ein Rechteck gezeichnet werden, ähnlich von Windows.. das Markieren mit der Maus.</p>
<p>Problem ist, dass sobald das Programm startet, Rectangles gezeichnet werden, bis der erste Klick erfolgt. Wie kann ich das abfangen?</p>
<p>[code]<br />
void CRechteck_zeichnenView::OnMouseMove(UINT nFlags, CPoint point)<br />
{<br />
m_point[0].x=point.x;<br />
m_point[0].y=point.y;</p>
<p>CClientDC dc(this);</p>
<p>dc.Rectangle(m_point[0].x,m_point[0].y,m_point[1].x,m_point[1].y);</p>
<p>if(iFlag==1){<br />
Invalidate();<br />
}<br />
CView::OnMouseMove(nFlags, point);<br />
}</p>
<p>void CRechteck_zeichnenView::OnLButtonDown(UINT nFlags, CPoint point)<br />
{<br />
m_point[1].x=point.x;<br />
m_point[1].y=point.y;</p>
<p>CView::OnLButtonDown(nFlags, point);<br />
}</p>
<p>void CRechteck_zeichnenView::OnLButtonUp(UINT nFlags, CPoint point)<br />
{<br />
iFlag=1;</p>
<p>CView::OnLButtonUp(nFlags, point);<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174594/abfangen-von-wm_messages</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 12:11:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174594.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Feb 2007 21:00:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Abfangen von Wm_Messages on Wed, 28 Feb 2007 21:00:04 GMT]]></title><description><![CDATA[<p>Erneute Anfrage:</p>
<p>Ich habe mal vor kurzem die Frage gestellt, ob es geht MouseEvents... abzufangen.</p>
<p>Dabei kam die Antwort: Hooks könnten diese abfangen.<br />
Nur, wie realisiert man Hooks.</p>
<p>Mein Problem:</p>
<p>Einfache Aufgabe.<br />
Es soll über die Messages Mouse Move,ButtonUp,Button Down ein Rechteck gezeichnet werden, ähnlich von Windows.. das Markieren mit der Maus.</p>
<p>Problem ist, dass sobald das Programm startet, Rectangles gezeichnet werden, bis der erste Klick erfolgt. Wie kann ich das abfangen?</p>
<p>[code]<br />
void CRechteck_zeichnenView::OnMouseMove(UINT nFlags, CPoint point)<br />
{<br />
m_point[0].x=point.x;<br />
m_point[0].y=point.y;</p>
<p>CClientDC dc(this);</p>
<p>dc.Rectangle(m_point[0].x,m_point[0].y,m_point[1].x,m_point[1].y);</p>
<p>if(iFlag==1){<br />
Invalidate();<br />
}<br />
CView::OnMouseMove(nFlags, point);<br />
}</p>
<p>void CRechteck_zeichnenView::OnLButtonDown(UINT nFlags, CPoint point)<br />
{<br />
m_point[1].x=point.x;<br />
m_point[1].y=point.y;</p>
<p>CView::OnLButtonDown(nFlags, point);<br />
}</p>
<p>void CRechteck_zeichnenView::OnLButtonUp(UINT nFlags, CPoint point)<br />
{<br />
iFlag=1;</p>
<p>CView::OnLButtonUp(nFlags, point);<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237083</guid><dc:creator><![CDATA[Ulf_Merboldt]]></dc:creator><pubDate>Wed, 28 Feb 2007 21:00:04 GMT</pubDate></item><item><title><![CDATA[Reply to Abfangen von Wm_Messages on Wed, 28 Feb 2007 21:08:21 GMT]]></title><description><![CDATA[<p>ich verseth nicht so ganz was du willst ... das hat wenig mit einem Hook zu tun was du da hast ... das sind eher 2 Funktionen, die auch noch jeweils eine gleichnamige Funktion einer anderen Klasse aufrufen(wobei ich davon ausgehe das das die Basisklasse ist ...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237090</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Wed, 28 Feb 2007 21:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Abfangen von Wm_Messages on Wed, 28 Feb 2007 22:11:21 GMT]]></title><description><![CDATA[<p>Versuch's mal so...</p>
<p>Im Konstruktor unbedingt<br />
flag = 0;<br />
setzen.</p>
<p>[code]<br />
void CRechteck_zeichnenView::OnMouseMove(UINT nFlags, CPoint point)<br />
{<br />
if (iFlag==1)<br />
{<br />
m_point[0].x=point.x;<br />
m_point[0].y=point.y;</p>
<p>CClientDC dc(this);</p>
<p>dc.Rectangle(m_point[0].x,m_point[0].y,m_point[1].x,m_point[1].y);<br />
Invalidate();<br />
}<br />
}</p>
<p>Dein Problem ist die Zusstandslogik, nicht die Messageverarbeitung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237136</guid><dc:creator><![CDATA[Die_Gute_Fee]]></dc:creator><pubDate>Wed, 28 Feb 2007 22:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to Abfangen von Wm_Messages on Wed, 28 Feb 2007 22:12:48 GMT]]></title><description><![CDATA[<p>Achja ...</p>
<p>void CRechteck_zeichnenView::OnLButtonDown(UINT nFlags, CPoint point)<br />
{<br />
flag = 0; //wichtig<br />
m_point[1].x=point.x;<br />
m_point[1].y=point.y;</p>
<p>CView::OnLButtonDown(nFlags, point);<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237137</guid><dc:creator><![CDATA[Die_Gute_Fee]]></dc:creator><pubDate>Wed, 28 Feb 2007 22:12:48 GMT</pubDate></item><item><title><![CDATA[Reply to Abfangen von Wm_Messages on Wed, 28 Feb 2007 22:18:42 GMT]]></title><description><![CDATA[<p>upps vertippt...</p>
<p>in<br />
void CRechteck_zeichnenView::OnLButtonDown(UINT nFlags, CPoint point)<br />
flag = 1;</p>
<p>in<br />
void CRechteck_zeichnenView::OnLButtonUp(UINT nFlags, CPoint point)<br />
flag = 0;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237141</guid><dc:creator><![CDATA[Die_Gute_Fee]]></dc:creator><pubDate>Wed, 28 Feb 2007 22:18:42 GMT</pubDate></item></channel></rss>