<?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[CListCtrl NM_CLICK kann man da an NM_MOUSE heran?]]></title><description><![CDATA[<pre><code class="language-cpp">ON_NOTIFY(NM_CLICK, IDC_LIST1, OnClickList1)

void CTest001Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult) 
{
    CString str;
    str.Format(&quot;Code: %i  IdFrom: %i  FensterFrom: %i&quot;, 
        pNMHDR-&gt;code, pNMHDR-&gt;idFrom, pNMHDR-&gt;hwndFrom);

    MessageBox(str);

    *pResult = 0;
}
</code></pre>
<p>Kann man über die Nachricht NM_CLICK an weitere Infos kommen außer an diese in NMHDR, z.B. an die NMMOUSE Struktur? Was kann man mit pResult anfangen außer auf 0 setzen?</p>
<p>Auszug aus commctrl.h:</p>
<pre><code class="language-cpp">typedef NMMOUSE NMCLICK;

typedef struct tagNMMOUSE 
{
    NMHDR   hdr;
    DWORD   dwItemSpec;
    DWORD   dwItemData;
    POINT   pt;
    DWORD   dwHitInfo; // any specifics about where on the item or control the mouse is
} NMMOUSE, FAR* LPNMMOUSE;

#define NM_FIRST                (0U-  0U)       // generic to all controls
#define NM_LAST                 (0U- 99U)

//====== Generic WM_NOTIFY notification codes =================================
#define NM_OUTOFMEMORY          (NM_FIRST-1)
#define NM_CLICK                (NM_FIRST-2)    // uses NMCLICK struct
#define NM_DBLCLK               (NM_FIRST-3)
#define NM_RETURN               (NM_FIRST-4)
#define NM_RCLICK               (NM_FIRST-5)    // uses NMCLICK struct
#define NM_RDBLCLK              (NM_FIRST-6)
#define NM_SETFOCUS             (NM_FIRST-7)
#define NM_KILLFOCUS            (NM_FIRST-8)
#if (_WIN32_IE &gt;= 0x0300)
#define NM_CUSTOMDRAW           (NM_FIRST-12)
#define NM_HOVER                (NM_FIRST-13)
#endif
#if (_WIN32_IE &gt;= 0x0400)
#define NM_NCHITTEST            (NM_FIRST-14)   // uses NMMOUSE struct
#define NM_KEYDOWN              (NM_FIRST-15)   // uses NMKEY struct
#define NM_RELEASEDCAPTURE      (NM_FIRST-16)
#define NM_SETCURSOR            (NM_FIRST-17)   // uses NMMOUSE struct
#define NM_CHAR                 (NM_FIRST-18)   // uses NMCHAR struct
#endif

#ifndef CCSIZEOF_STRUCT
#define CCSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&amp;((structname*)0)-&gt;member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)-&gt;member))
#endif

#if (_WIN32_IE &gt;= 0x0400)
//====== Generic WM_NOTIFY notification structures ============================
</code></pre>
<p>Wie komme ich an das pt in NM_MOUSE?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/150848/clistctrl-nm_click-kann-man-da-an-nm_mouse-heran</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 09:35:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150848.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Jun 2006 19:20:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Tue, 20 Jun 2006 19:20:38 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">ON_NOTIFY(NM_CLICK, IDC_LIST1, OnClickList1)

void CTest001Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult) 
{
    CString str;
    str.Format(&quot;Code: %i  IdFrom: %i  FensterFrom: %i&quot;, 
        pNMHDR-&gt;code, pNMHDR-&gt;idFrom, pNMHDR-&gt;hwndFrom);

    MessageBox(str);

    *pResult = 0;
}
</code></pre>
<p>Kann man über die Nachricht NM_CLICK an weitere Infos kommen außer an diese in NMHDR, z.B. an die NMMOUSE Struktur? Was kann man mit pResult anfangen außer auf 0 setzen?</p>
<p>Auszug aus commctrl.h:</p>
<pre><code class="language-cpp">typedef NMMOUSE NMCLICK;

typedef struct tagNMMOUSE 
{
    NMHDR   hdr;
    DWORD   dwItemSpec;
    DWORD   dwItemData;
    POINT   pt;
    DWORD   dwHitInfo; // any specifics about where on the item or control the mouse is
} NMMOUSE, FAR* LPNMMOUSE;

#define NM_FIRST                (0U-  0U)       // generic to all controls
#define NM_LAST                 (0U- 99U)

//====== Generic WM_NOTIFY notification codes =================================
#define NM_OUTOFMEMORY          (NM_FIRST-1)
#define NM_CLICK                (NM_FIRST-2)    // uses NMCLICK struct
#define NM_DBLCLK               (NM_FIRST-3)
#define NM_RETURN               (NM_FIRST-4)
#define NM_RCLICK               (NM_FIRST-5)    // uses NMCLICK struct
#define NM_RDBLCLK              (NM_FIRST-6)
#define NM_SETFOCUS             (NM_FIRST-7)
#define NM_KILLFOCUS            (NM_FIRST-8)
#if (_WIN32_IE &gt;= 0x0300)
#define NM_CUSTOMDRAW           (NM_FIRST-12)
#define NM_HOVER                (NM_FIRST-13)
#endif
#if (_WIN32_IE &gt;= 0x0400)
#define NM_NCHITTEST            (NM_FIRST-14)   // uses NMMOUSE struct
#define NM_KEYDOWN              (NM_FIRST-15)   // uses NMKEY struct
#define NM_RELEASEDCAPTURE      (NM_FIRST-16)
#define NM_SETCURSOR            (NM_FIRST-17)   // uses NMMOUSE struct
#define NM_CHAR                 (NM_FIRST-18)   // uses NMCHAR struct
#endif

#ifndef CCSIZEOF_STRUCT
#define CCSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&amp;((structname*)0)-&gt;member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)-&gt;member))
#endif

#if (_WIN32_IE &gt;= 0x0400)
//====== Generic WM_NOTIFY notification structures ============================
</code></pre>
<p>Wie komme ich an das pt in NM_MOUSE?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081648</guid><dc:creator><![CDATA[MFC_uups]]></dc:creator><pubDate>Tue, 20 Jun 2006 19:20:38 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Tue, 20 Jun 2006 19:44:32 GMT]]></title><description><![CDATA[<p>Durch einen cast<br />
NMCLICK *pnmClick = (NMCLICK*)pNMHDR;<br />
Aber Du kommst auch per GetMessagePos an die Cursor Position der Maus ran.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081662</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 20 Jun 2006 19:44:32 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Tue, 20 Jun 2006 22:29:21 GMT]]></title><description><![CDATA[<p>Befindet sich NMHDR und NMCLICK an der gleichen Adresse?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081743</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081743</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Tue, 20 Jun 2006 22:29:21 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Thu, 22 Jun 2006 09:52:28 GMT]]></title><description><![CDATA[<p>BOOL CLVCDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)<br />
{<br />
if( wParam == IDC_LIST1 &amp;&amp; ((NMHDR*)lParam)-&gt;code == NM_CLICK)<br />
{<br />
static int i = 0;<br />
i++;<br />
CString str;<br />
str.Format(&quot;%i %i&quot;,((NMCLICK*)lParam)-&gt;pt.x, ((NMCLICK*)lParam)-&gt;pt.y);<br />
m_List2.InsertItem(i,str);<br />
}</p>
<p>return CDialog::OnNotify(wParam, lParam, pResult);<br />
}</p>
<p>Ergibt 0 und 1031 egal, wohin in IDC_LIST1 geklickt wird. Warum?<br />
...-&gt;dwHitInfo funktioniert z.B.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082782</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082782</guid><dc:creator><![CDATA[eh@work]]></dc:creator><pubDate>Thu, 22 Jun 2006 09:52:28 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Thu, 22 Jun 2006 10:22:26 GMT]]></title><description><![CDATA[<p>BOOL CLVCDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)<br />
{<br />
if( wParam == IDC_LIST1 &amp;&amp; ((NMHDR*)lParam)-&gt;code == NM_CLICK)<br />
{<br />
static int i = 0;<br />
i++;<br />
CString str;<br />
str.Format(&quot;%i %i&quot;,((NMCLICK*)lParam)-&gt;pt.x, ((NMCLICK*)lParam)-&gt;pt.y);<br />
m_List2.InsertItem(i,str);<br />
}</p>
<p>return CDialog::OnNotify(wParam, lParam, pResult);<br />
}</p>
<p>Ergibt 0 und 1031 egal, wohin in IDC_LIST1 geklickt wird. Warum?<br />
...-&gt;dwHitInfo funktioniert z.B.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082792</guid><dc:creator><![CDATA[eh@work]]></dc:creator><pubDate>Thu, 22 Jun 2006 10:22:26 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Wed, 25 Sep 2013 20:08:40 GMT]]></title><description><![CDATA[<p>..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084155</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Wed, 25 Sep 2013 20:08:40 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl NM_CLICK kann man da an NM_MOUSE heran? on Sat, 24 Jun 2006 06:58:51 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void CListCtrlDemoDlg::OnClickListCtrl(NMHDR* pNMHDR, LRESULT* pResult) 
{	
	CPoint point;
	::GetCursorPos(&amp;point);
	CString str;
	str.Format(_T(&quot;OnClickListCtrl.  Cursor position is x: %d, y: %d&quot;), point.x, point.y);
	m_Log.AppendString(str);

	*pResult = 0;
}
</code></pre>
<p>Das ist die Variante mit</p>
<pre><code class="language-cpp">::GetCursorPos(...)
</code></pre>
<p>Hier allerdings nicht auf das Listenelement, sondern auf den Dialog bezogen,<br />
aus: <a href="http://www.codeproject.com/listctrl/listctrldemo.asp" rel="nofollow">http://www.codeproject.com/listctrl/listctrldemo.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084315</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sat, 24 Jun 2006 06:58:51 GMT</pubDate></item></channel></rss>