Declare Function SetRect Lib "user32.dll" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
SetRect sets the position and size of a rectangle. The two coordinates specified are the upper-left and lower-right corners of the rectangle. The function returns 0 if an error occured, or a non-zero value if successful.
Example:
' Set the position of rectangle r
' (This could also be done by setting its .Left, .Top, etc. values manually)
Dim r As RECT
x = SetRect(r, 50, 20, 100, 70) ' r = (50,20)-(100,70)
Related Call: SetRectEmpty