PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Mark Strickland on December 03, 2005, 11:34:31 PM

Title: ListView and RIGHT clicks
Post by: Mark Strickland on December 03, 2005, 11:34:31 PM
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?
Title: ListView and RIGHT clicks
Post by: TechSupport on December 04, 2005, 01:22:54 PM
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