Get LVN_MARQUEEBEGIN in CListCtrl
-
Could these discussion help you? [https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin\](https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin) [https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse\](https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse)
I have noted those discussion before, no clue..
-
I have a class inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in the method OnNotify() of my class when clicking and dragging??? :( :( :(
BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;switch(pnmv->hdr.code){ case LVN\_MARQUEEBEGIN: ; // Deal with some case here. break; } return CListCtrl::OnNotify(wParam, lParam, pResult);
}
-
I have noted those discussion before, no clue..
Then perhaps you'll describe how you are doing the "dragging" anw how and in what class you are handling this notification... :suss:
-
Then perhaps you'll describe how you are doing the "dragging" anw how and in what class you are handling this notification... :suss:
Click the left button, hold on it and move the mouse to somewhere else, no any message receive... My codes as below:
BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;switch(pnmv->hdr.code){ case LVN\_MARQUEEBEGIN: ; // Deal with some case here. break; } return CListCtrl::OnNotify(wParam, lParam, pResult);
}
This method is trigged only when move mouse into the dialog which contains CListCtrlEx object, message type is TTN_GETDISPINFOW.
-
Updated my question, added related codes.
-
Updated my question, added related codes.
-
Click the left button, hold on it and move the mouse to somewhere else, no any message receive... My codes as below:
BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;switch(pnmv->hdr.code){ case LVN\_MARQUEEBEGIN: ; // Deal with some case here. break; } return CListCtrl::OnNotify(wParam, lParam, pResult);
}
This method is trigged only when move mouse into the dialog which contains CListCtrlEx object, message type is TTN_GETDISPINFOW.
I added the message handler for LVN_MARQUEEBEGIN in my CListCtrl derived class:
BEGIN_MESSAGE_MAP(CListOptionsCtrl, CListCtrl)
ON_NOTIFY_REFLECT(LVN_MARQUEEBEGIN, &CListOptionsCtrl::OnLvnMarqueeBegin)
...
void CListOptionsCtrl::OnLvnMarqueeBegin(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
}and it does work. :suss:
-
I have a class inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in the method OnNotify() of my class when clicking and dragging??? :( :( :(
BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;switch(pnmv->hdr.code){ case LVN\_MARQUEEBEGIN: ; // Deal with some case here. break; } return CListCtrl::OnNotify(wParam, lParam, pResult);
}
Li Lin 2023 wrote:
BOOL CListCtrlEx::OnNotify
You cannot capture it there. You will need to use [ON_NOTIFY_REFLECT](https://learn.microsoft.com/en-us/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170) if you want to capture LVN_MARQUEEBEGIN in your CListCtrl derived class. Or as Richard pointed out you can capture that message in the parent window.
-
Li Lin 2023 wrote:
BOOL CListCtrlEx::OnNotify
You cannot capture it there. You will need to use [ON_NOTIFY_REFLECT](https://learn.microsoft.com/en-us/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170) if you want to capture LVN_MARQUEEBEGIN in your CListCtrl derived class. Or as Richard pointed out you can capture that message in the parent window.
Got it, thank you!
-
Got it, thank you!