Not a Member Yet,
Click here to Register
How do you like the new design?






ID: 134
Viewed: 2454
Added: Apr 28, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

Windows API Guide: EqualRect Function Platforms: Win 32s, Win 95/98, Win NT EqualRect determines if two rectangles are equal. Rectangles are considered equal if and only if the upper-left and lower-right corners (the points that define the rectangles) of one rectangle are equal to those of another. The function returns 1 if the two rectangles are equal and 0 if they are unequal. lpRect1The first of the two rectangles to check. lpRect2The second of the two rectangles to check.

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
'Example:
' Demonstrate equal and unequal rectangles
Dim r As RECT, s As RECT ' rectangles to use
Dim areequal As Long ' receives whether the rectangles are equal or not
Dim retval As Long ' return value
' Initialize the two rectangles using the API
retval = SetRect(r, 15, 20, 100, 110) ' r = (15,20)-(100,110)
retval = SetRect(s, 15, 20, 100, 110) ' s = (15,20)-(100,110)
areequal = EqualRect(r, s) ' compare the rectangles
If areequal = 1 Then Debug.Print "Are Equal" Else Debug.Print "Are Not Equal"
' Change the second rectangle
retval = SetRect(s, 30, 45, 200, 250) ' s = (30,45)-(200,250)
areequal = EqualRect(r, s) ' compare the rectangles
If areequal = 1 Then Debug.Print "Are Equal" Else Debug.Print "Are Not Equal"
' The first time is Are Equal, the second is Are Not Equal.;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions