Hi,

How would i draw a black rectangle around the edge of a control
let's say a button... like the visual ressource editor does, when
u put a button on a dialog, and u want to resize it ?


is there any API, or should i subclass the control and handle the paintaing stage...


Thanks,
Posted on 2002-05-20 18:45:39 by Sabeel
In response to a WM_PAINT message:



INVOKE GetClientRect ,hCtl,ADDR rect ;Get the rect of the child window relative to the windows client co-ordinates

;GetClientRect returns Left/Top with X,Y position. Right/Bottom contain width height
mov eax,rect.left
add rect.right,eax
mov eax,rect.top
add eax,rect.bottom

dec rect.left ;Make a space for the frame
dec rect.top
inc rect.right
inc rect.bottom

INVOKE GetStockObject ,BLACK_BRUSH ;The brush to use for the painting
INVOKE FrameRect ,hDC,ADDR rect,eax ;Use GDI to paint it for us


hCtl - The child window you want to frame
rect - An allocated rect structure
hDC - The DC returned by BeginPaint

PS: I have double checked my code but I havn't tested but whats there should work.
Posted on 2002-05-20 19:52:16 by huh