<?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[Frage zum Contextmenü]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>nochmals eine Frage,</p>
<p>ich erstelle in einem CFormView mit der rechten Maustaste ein Contextmenü.</p>
<p>Dies Klappt auch.</p>
<p>Nun möchte ich in meiner Ansicht Abgeleitet von CTreeView diese ebenfalls machen.</p>
<p>Dort klappt es zwar auch, aber nur wenn ich doppelt mit der Rechten Maustaste Drücke ??</p>
<p>Geht das nicht anders ??</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">void CNaviView::OnContextMenu(CWnd* pWnd, CPoint point)
{
	// TODO: Fügen Sie hier Ihren Meldungsbehandlungscode ein.
	CMenu menu;

	// Kontextmenü laden
	menu.LoadMenu(IDR_MENU1);
	// Erstes Untermenü 

	CMenu * pContextMenu = menu.GetSubMenu(0);

	HTREEITEM hSelectedItem = GetTreeCtrl().GetSelectedItem();

	AfxMessageBox(GetTreeCtrl().GetItemText(hSelectedItem));

	// Kontextmenü anzeigen
	pContextMenu-&gt;TrackPopupMenu(TPM_CENTERALIGN + TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd()); 

}
</code></pre>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/77965/frage-zum-contextmenü</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 01:34:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/77965.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Jun 2004 11:25:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zum Contextmenü on Sat, 26 Jun 2004 11:25:37 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>nochmals eine Frage,</p>
<p>ich erstelle in einem CFormView mit der rechten Maustaste ein Contextmenü.</p>
<p>Dies Klappt auch.</p>
<p>Nun möchte ich in meiner Ansicht Abgeleitet von CTreeView diese ebenfalls machen.</p>
<p>Dort klappt es zwar auch, aber nur wenn ich doppelt mit der Rechten Maustaste Drücke ??</p>
<p>Geht das nicht anders ??</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">void CNaviView::OnContextMenu(CWnd* pWnd, CPoint point)
{
	// TODO: Fügen Sie hier Ihren Meldungsbehandlungscode ein.
	CMenu menu;

	// Kontextmenü laden
	menu.LoadMenu(IDR_MENU1);
	// Erstes Untermenü 

	CMenu * pContextMenu = menu.GetSubMenu(0);

	HTREEITEM hSelectedItem = GetTreeCtrl().GetSelectedItem();

	AfxMessageBox(GetTreeCtrl().GetItemText(hSelectedItem));

	// Kontextmenü anzeigen
	pContextMenu-&gt;TrackPopupMenu(TPM_CENTERALIGN + TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd()); 

}
</code></pre>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/548383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/548383</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Sat, 26 Jun 2004 11:25:37 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zum Contextmenü on Mon, 28 Jun 2004 07:58:27 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>hat mir keiner einen Rat ??</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549170</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Mon, 28 Jun 2004 07:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zum Contextmenü on Tue, 29 Jun 2004 12:32:22 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann mir jemand sagen, warum man in einem CTreeCtrl nur mit doppeltem Rechts Klick ein Contextmenü öffnen kann ??</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549787</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Tue, 29 Jun 2004 12:32:22 GMT</pubDate></item></channel></rss>