On 07/08/2012 18:04, Farnsworth wrote:
> "Deanna Earley" <
dee.e...@icode.co.uk> wrote in message
> news:jvr7hb$kp6$1...@speranza.aioe.org...
>> On 07/08/2012 14:52, -mhd wrote:
>>> Are the values represented by Right and Bottom supposed to be absolute or
>>> relative to Left and Top?
>>
>> They are the absolute right and bottom coordinates*. If they were
>> relative, they would be called width and height.
>>
>> * exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
>>
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
>
> You probably were thinking of something else. Right and Bottom are always
> relative to Left and Top.
No they're not.
If what you say is true, it makes that entire article rubbish, and this
from MSDN:
> The structure specifies the coordinates of two points: the upper left and lower right corners of the rectangle.
and:
> The coordinate value of a rectangle's right side must be greater than that of its left side.
> Some functions always set Left and Top to 0, such
> as GetClientRect(), but not GetWindowRect(), so subtracting from Left and
> Top always gets you the correct numbers.
You've just contradicted yourself there. subtracting makes no sense if
they're relative anyway (Only addition would be necessary).
Having said all that, A RECT is purely a container so it's entirely down
to the creator and consumer to agree on how to interpret it. Accepted
practice says top left inclusive to bottom right exclusive.