In the DDT world, I use this next line of code all the time, including within the dialog CallBack function, under various ListView notifications. It's easy enough to use.
I also use these SDK code examples sometimes. But I don't have a complete listing of ListView notifications from which row/col can be extracted, nor the extraction code. These 5 notifications cover most of my needs but I wondered if anyone has documented how to get row/col for all ListView notifications from which row/col can be extracted? I'm not sure what all ListView notifications that involves.
And, of course, if there's anything wrong with this code, feedback is welcome.
Code:
ListView Get Select hDlg, %IDC_ListView to iRow
Code:
Local pLVDI As LV_DISPINFOW Ptr Local LVNT As NMItemActivate Ptr Local LVData As NM_ListView Local pNMLV As NMLISTVIEW Ptr Case %LVN_GetDispInfo pLVDI = Cb.LParam iRow = @pLVDI.item.iItem+1 iCol = @pLVDI.item.iSubItem+1 Case %NM_Click LVNT = Cb.LParam iRow = @LVNT.iItem+1 iCol = @LVNT.iSubItem+1 Case %NM_DblClk LVNT = Cb.LParam iRow = @LVNT.iItem+1 iCol = @LVNT.iSubItem+1 Case %LVN_ColumnClick Type Set LVData = Cb.NmHdr$(SizeOf(LVData)) iRow = LVData.iItem+1 iCol = LVData.iSubItem+1 Case %LVN_ItemChanged 'Mouse Click or Keyboard Arrow will cause this pNMLV = Cb.LParam iRow = @pNMLV.iItem+1 iCol = @pNMLV.iSubItem+1
Comment