I Know how to use the RECT I just wanted to know if anyone had a little macro or proc that I could send two values, width and height of the RECTANGLE and it would return four values that I could place in the RECT STRUCT? I do now how to figue it out but I need it to do it with many different things that would be going on at run time it would just make things easier...
Posted on 2001-03-01 02:13:00 by Zcoder
hi, what your asking can be easily done. However, unless some co ordinates for two edges (left or right) and (top or bottom) are specified, the resulting RECT structure will contain coordinates which may not be what you want i.e a window 100x100 units can be anywhere(depends on implementation) on the screen unless some anchoring co ordinates are specified. GeO
Posted on 2001-03-01 06:29:00 by GeO
Warning, untested code follows:

FillRect PROC dwWidth:DWORD, dwHeight:DWORD, pRect:DWORD
   mov ecx, pRect
   mov eax, 0
   mov .RECT.left, eax
   mov .RECT.right, eax
   mov eax, dwHeight
   mov .RECT.top, eax
   mov eax, dwWidth
   mov .RECT.bottom, eax
FillRect ENDP

; or for thos inline code fans:

FillRect MACRO dwWidth:REQ, dwHeight:REQ, Rect:REQ
   xor eax, eax      ; just to show-off  ;-)
   mov Rect.left, eax
   mov Rect.right, eax
   mov eax, dwHeight
   mov Rect.top, eax
   mov eax, dwWidth
   mov Rect.bottom, eax

Basically, this proc gets the address of an existing rect structure, a width and height for the rect, sets the origin to 0,0 and fills in the height and width with the values supplied. This message was edited by Ernie, on 3/1/2001 5:35:01 PM This message was edited by Ernie, on 3/1/2001 8:20:47 PM
Posted on 2001-03-01 17:34:00 by Ernie