'listview column text
'   检索 ListView 列标题的文本。
'   hWndControl:  控件的句柄 (例如  HWND_FORM1_LISTVIEW1)   
'   iPosition:    从零开始，列的索引。
'   Returns:      Returns the column header text.
Function FF_ListView_GetColumnText(ByVal hWndControl as HWnd, ByVal iPosition as Long) as CWSTR 
   
   Dim tlvc as LV_COLUMNW
   Dim zText as wString * MAX_PATH
   
   '检查窗口句柄是否有效
   If IsWindow(hWndControl) Then
      
      tlvc.mask = LVCF_TEXT
      tlvc.pszText = VarPtr(zText)
      tlvc.cchTextMax = SizeOf(zText)
      
      If SendMessageW(hWndControl, LVM_GETCOLUMNW, iPosition, Cast(LPARAM, VarPtr(tlvc))) Then
         Return zText
      End If
      
   End If
   
End Function

