'listview column text
'   设置列表视图中列的标题文本。
'   hWndControl:    控件的句柄 (例如  HWND_FORM1_LISTVIEW1)   
'   iPosition:      从零开始，列的索引。
'   nAlignment:     %LVCFMT_CENTER      文本居中
'                   %LVCFMT_LEFT        文本是左对齐
'                   %LVCFMT_RIGHT       文本为右对齐
'   Returns:        如果成功的话，新列的索引，否则为-1。
Function FF_ListView_SetColumnText(ByVal hWndControl as HWnd, ByVal iPosition as Long, ByRef TheText as CWSTR ) as Long
   
   Dim tlvc as LV_COLUMNW
   
   '检查窗口句柄是否有效
   If IsWindow(hWndControl) Then
      
      tlvc.mask = LVCF_TEXT
      tlvc.pszText = Cast(LPWSTR,TheText.vptr)
      Function = SendMessageW(hWndControl, LVM_SETCOLUMNW, iPosition, Cast(LPARAM, VarPtr(tlvc)))
      
   End If
   
End Function

