Question about listviews and %WM_LBUTTONUP

Started by Elias Montoya, February 09, 2012, 08:35:37 PM

Previous topic - Next topic

Elias Montoya


I cant get the %WM_LBUTTONUP event for single clicks in a listview, but i get them fine with double clicks. Like this:

Click [nothing]

Click [nothing] Click [%WM_LBUTTONUP]

How come?
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

Paul Squires

do a search in the form for nm_click. That is  better choice for handling listview clicks.
Paul Squires
PlanetSquires Software

Rolf Brandt

Hello Elias,

I usually handle listview mouse events in the forms Custom Event (See code example). That works ok. There might of course be better solutions.


Function FRMRECCURRENT_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 lpNmh  As NMHDR Ptr
   Local lpLvNm As NM_LISTVIEW Ptr
   
   Local lLvItem        As Long
   Local lLvSubItem    As Long

   Select Case wMsg
      Case %WM_NOTIFY
         lpNmh = lParam
         If @lpNmh.idFrom = IDC_FRMRECCURRENT_LISTVIEW1 Then
            lpLvNm = lParam
            Select Case @LpLvNm.hdr.Code
               Case %NM_DBLCLK   'left double-click
               Case  %NM_CLICK             
               Case %NM_RCLICK
               Case Else
            End Select
         End If
      Case Else
   End Select

End Function


Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Elias Montoya

Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

Rolf Brandt

Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)