'size
'   设置指定的控件或窗体的大小 （以像素为单位）。
'   hWndControl: 窗体或控件的句柄 (例如  HWND_FORM1_COMMAND1)
'   nWidth:      The new width of the window in pixels.
'   nHeight:     The new height of the window in pixels.
'   Returns:     0 if error, non-zero if successful
Function FF_Control_SetSize( ByVal hWndControl as HWnd, _
                             ByVal nWidth as Long, _
                             ByVal nHeight as Long _
                             ) as Long
    
    Dim rc as Rect
    
    ' This function works for both Forms and Controls.
    
    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then
       
       ' Set the dimensions of the window
         Function = SetWindowPos( hWndControl, 0, 0, 0, nWidth, nHeight, _
                      SWP_NOZORDER Or SWP_NOMOVE or SWP_NOACTIVATE)
       
    End If
    
End Function

