ListView and RIGHT clicks

Started by Mark Strickland, December 03, 2005, 11:34:31 PM

Previous topic - Next topic

Mark Strickland

I have a ListView control and I want to respond to these:

DOUBLE LEFT CLICK
SINGLE RIGHT CLICK

I put in some CUSTOM code for DOUBLE LEFT CLICK first and everything works great.  I added a different WM_RBUTTONUP case to the CUSTOM message and strangely it only responds to DOUBLE right clicks.

Any thoughts?

TechSupport

Hi Mark,

Maybe the following code is better to respond to ListView clicks:

Function FORM1_CUSTOM ( _
                     hWndForm      As Dword, _  ' handle of Form
                     wMsg          As Long,  _  ' type of message
                     wParam        As Dword, _  ' first message parameter
                     lParam        As Long   _  ' second message parameter
                     ) As Long

 
 Local pNMLV As NM_LISTVIEW Ptr
 
 Select Case wMsg
   
    Case %WM_NOTIFY
           pNMLV = lParam
           
           Select Case @pNMLV.hdr.idfrom
           
                Case IDC_FORM1_LISTVIEW1        ' notify message from the listview control
                   
                    Select Case @pNMLV.hdr.code

                          Case %NM_CLICK    'left click        
                         
                          Case %NM_DBLCLK   'left double-click
                               
                          Case %NM_RCLICK   ' right click

                          Case %NM_RDBLCLK   'right double-click

                    End Select
                   
           End Select                      
 
 End Select
 
End Function