'listview column alignment
'   设置 ListView 列标题的对齐方式。如果将项目添加到列表视图然后他们保留他们原来的对齐方式。
'   hWndControl:    控件的句柄 (例如  HWND_FORM1_LISTVIEW1)   
'   iPosition:      从零开始，列的索引。
'   nAlignment:     %LVCFMT_CENTER      文本居中
'                   %LVCFMT_LEFT        文本是左对齐
'                   %LVCFMT_RIGHT       文本为右对齐
'   Returns:        如果成功返回 %TRUE 否则为 %FALSE 
Function FF_ListView_SetColumnAlignment(ByVal hWndControl as HWnd, ByVal iPosition as Long, ByVal nAlignment as Long) as Integer
   
   Dim tlvc as LV_COLUMN
   
   '检查窗口句柄是否有效
   If IsWindow(hWndControl) Then
      
      tlvc.mask = LVCF_FMT
      tlvc.fmt = nAlignment
      Function = SendMessage(hWndControl, LVM_SETCOLUMN, iPosition, Cast(LPARAM, VarPtr(tlvc)))
      
   End If
   
End Function

