Home > Software engineering >  CListCtrl mouse messages do not respond to the client area
CListCtrl mouse messages do not respond to the client area

Time:09-22

Hello everyone, I am in the process of the draw CListCtrl, expanded the part of the area, and then hope to respond to the mouse message in this area, but to join the wm_nclbuttondown, wm_nclbuttonup messages, but no response, join wm_nchittest message, the message, that the client area exists,

How do I let CListCtrl response of the client area of the mouse message, thank you!

CodePudding user response:

SPY++ see non-client area click on any news

CodePudding user response:

The derived
Void CMyListCtrl: : OnNcLButtonDown (UINT nHitTest, CPoint point)
{
//TODO: Add your message handler code here and/or call the default
AfxDump & lt; & lt; "CMyListCtrl: : OnNcLButtonDown \ n";
CListCtrl: : OnNcLButtonDown (nHitTest, point);
}

Void CMyListCtrl: : OnNcLButtonUp (UINT nHitTest, CPoint point)
{
//TODO: Add your message handler code here and/or call the default
AfxDump & lt; & lt; "CMyListCtrl: : OnNcLButtonUp \ n";
CListCtrl: : OnNcLButtonUp (nHitTest, point);
}
Click on the border!

CodePudding user response:

Do not check the @ zg7093 lspy++ away how
Unable to enter @ schlafenhamster message processing events

CodePudding user response:

"Message processing event cannot enter" "
This is normal operation of the code!
Click on the border! Outside the box!

CodePudding user response:

Don't know whether CListCtrl really have not the client area, can consider to use SetCapture function (... ) and the ReleaseCapture (... ) function binding the mouse have a try

CodePudding user response:

Key is the wm_nchittest message to return to the right things.

CodePudding user response:

Don't know whether CListCtrl really have not the client area,
The border is the
  • Related