'treeview lparam itemdata
'   设置指定项的lParam
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_TREEVIEW1)   
'   hItem:       The handle of the item to set the lParam for.
'   lParam:      The 32-bit lParam value to set.
'   Returns:     %TRUE if successful, %FALSE if otherwise
Function FF_TreeView_SetlParam (ByVal hWndControl as HWnd, _
                                ByVal hItem as HANDLE, _
                                ByVal lParam as Long) as Long


    Dim ti as TV_ITEM

    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then  

        ti.hItem  = hItem                                        
        ti.mask   = TVIF_PARAM
        ti.lParam = lParam
      
        If TreeView_SetItem (hWndControl, VarPtr(ti) ) = 0 Then
           Function = True
        End If   
    
    End If
    
End Function

