Detect right click on CHeaderCtrl 
Author Message
 Detect right click on CHeaderCtrl
Can anyone provide information on how to detect
a right button click on a CHeaderCtrl (on a
CListView control).

Thanks,

DeVerl



Mon, 19 Aug 2002 03:00:00 GMT  
 Detect right click on CHeaderCtrl
Create a new class CMyHeaderCtrl deriving from CHeaderCtrl and create a
handler for WM_RBUTTONDOWN message in there.

void CMyHeaderCtrl::OnRButtonDown(UINT nFlags, CPoint point)
{
        AfxMessageBox("On Right Button Down");        
        CHeaderCtrl::OnRButtonDown(nFlags, point);

Quote:
}

Now, create a member variable in your dialog/view class of type
CMyHeaderCtrl. Subclass the header control of your list control like below,

        m_myHeader.SubclassWindow(m_list.GetHeaderCtrl()->m_hWnd);

I have tested the above logic myself and it works.



Mon, 26 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detect left vs. right click event

2. problems detecting a right-click even on a rich edit control

3. (Q) Detecting right click in a CListBox

4. How to detect Right Click

5. Help: Detect when right button is clicked above a button

6. Detecting right click over dialog button.

7. Handling a Right Click

8. Right Click vs. Left

9. right Click - context menu ?

10. Treeview node right-click

11. on right click ?

12. Disabling right click in WebBrowser control

 

 
Powered by phpBB® Forum Software