'size rectangle area location
'   获取指定的控件或窗体的大小以像素为单位。
'   hWndControl: 窗体或控件的句柄 (例如  HWND_FORM1_COMMAND1)
'   Returns:     0 if error, non-zero if successful
'                nWidth returns the width of the window
'                nHeight returns the height of the window
Function FF_Control_GetSize( ByVal hWndControl as HWnd, _
                             ByRef nWidth as Long, _
                             ByRef nHeight as long _
                             ) as Integer
    
    Dim rc as Rect
    
    ' This function works for both Forms and Controls.
    
    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then
       
       ' Get the dimensions of the window
         Function = GetWindowRect( hWndControl, @rc)
       
       ' Return the Height and Width values back from the function
         nWidth  = (rc.Right - rc.Left)
         nHeight = (rc.Bottom - rc.Top)

    End If
    
End Function

