invoke GetSysColor,COLOR_BTNSHADOW
how do i change this color to green, dark green and light green?
is there a reference to color's somewhere on the net ?
how do i change this color to green, dark green and light green?
is there a reference to color's somewhere on the net ?
You will have to subclass a control and intercept the WM_PAINT message in order to change its border colour.
Paint_Proc proc hWin:DWORD, hDC:DWORD
LOCAL btn_hi :DWORD
LOCAL btn_lo :DWORD
LOCAL Rct :RECT
invoke GetSysColor,COLOR_BTNHIGHLIGHT
mov btn_hi, eax
invoke GetSysColor,COLOR_BTNSHADOW
mov btn_lo, eax
invoke Frame3D,hDC,btn_lo,btn_hi,17,430,770,510,2
invoke Frame3D,hDC,btn_hi,btn_lo,20,433,767,507,1
; --------------------------------------------------------
; The following 2 calls draw the border around the buttons
; --------------------------------------------------------
invoke Frame3D,hDC,btn_lo,btn_hi,645,20,770,305,2
invoke Frame3D,hDC,btn_hi,btn_lo,642,17,773,308,2
; -----------------------------------------------------
; The following 2 calls draw the left window frame area
; -----------------------------------------------------
invoke Frame3D,hDC,btn_lo,btn_hi,17,17,328,290,2
invoke Frame3D,hDC,btn_hi,btn_lo,20,20,325,287,1
; ----------------------------------------------------------
; The following code draws the border around the client area
; ----------------------------------------------------------
invoke GetClientRect,hWin,ADDR Rct
add Rct.left, 1
add Rct.top, 1
sub Rct.right, 1
sub Rct.bottom, 1
invoke Frame3D,hDC,btn_lo,btn_hi,
Rct.left,Rct.top,
Rct.right,Rct.bottom,2
add Rct.left, 4
add Rct.top, 4
sub Rct.right, 4
sub Rct.bottom, 4
invoke Frame3D,hDC,btn_hi,btn_lo,
Rct.left,
Rct.top,Rct.right,Rct.bottom,2
return 0
Paint_Proc endp
This is what i have. How can change it ? how do i intercept WM_PAINT ?
LOCAL btn_hi :DWORD
LOCAL btn_lo :DWORD
LOCAL Rct :RECT
invoke GetSysColor,COLOR_BTNHIGHLIGHT
mov btn_hi, eax
invoke GetSysColor,COLOR_BTNSHADOW
mov btn_lo, eax
invoke Frame3D,hDC,btn_lo,btn_hi,17,430,770,510,2
invoke Frame3D,hDC,btn_hi,btn_lo,20,433,767,507,1
; --------------------------------------------------------
; The following 2 calls draw the border around the buttons
; --------------------------------------------------------
invoke Frame3D,hDC,btn_lo,btn_hi,645,20,770,305,2
invoke Frame3D,hDC,btn_hi,btn_lo,642,17,773,308,2
; -----------------------------------------------------
; The following 2 calls draw the left window frame area
; -----------------------------------------------------
invoke Frame3D,hDC,btn_lo,btn_hi,17,17,328,290,2
invoke Frame3D,hDC,btn_hi,btn_lo,20,20,325,287,1
; ----------------------------------------------------------
; The following code draws the border around the client area
; ----------------------------------------------------------
invoke GetClientRect,hWin,ADDR Rct
add Rct.left, 1
add Rct.top, 1
sub Rct.right, 1
sub Rct.bottom, 1
invoke Frame3D,hDC,btn_lo,btn_hi,
Rct.left,Rct.top,
Rct.right,Rct.bottom,2
add Rct.left, 4
add Rct.top, 4
sub Rct.right, 4
sub Rct.bottom, 4
invoke Frame3D,hDC,btn_hi,btn_lo,
Rct.left,
Rct.top,Rct.right,Rct.bottom,2
return 0
Paint_Proc endp
This is what i have. How can change it ? how do i intercept WM_PAINT ?
Im lost here... Me and the MSDN have no clue what 'Frame3D' is, or how its parameters are to be set as...
As i gather your getting system RBG colors and passing them into the function, to draw a frame. You dont like the fact it the "normal" set of colors, and you want your own set of "private" colors.. Well this is easy.. just make your own color and pass it..
DWORD = 4 bytes = AABBGGRR
AA = 00 (always)
BB = (00 -> FF h :: Blue contribution)
GG = (00 -> FF h :: Green contribution)
RR = (00 -> FF h :: Red contribution)
For color black:
mov eax, 00000000h
For color Red:
mov eax, 000000FFh
For color white:
mov eax, 00FFFFFFh
Hope this is what your looking for.. basicaly skip the 'invoke GetSysColor' stuff and define what ever your looking for...
:nAn:
As i gather your getting system RBG colors and passing them into the function, to draw a frame. You dont like the fact it the "normal" set of colors, and you want your own set of "private" colors.. Well this is easy.. just make your own color and pass it..
DWORD = 4 bytes = AABBGGRR
AA = 00 (always)
BB = (00 -> FF h :: Blue contribution)
GG = (00 -> FF h :: Green contribution)
RR = (00 -> FF h :: Red contribution)
For color black:
mov eax, 00000000h
For color Red:
mov eax, 000000FFh
For color white:
mov eax, 00FFFFFFh
Hope this is what your looking for.. basicaly skip the 'invoke GetSysColor' stuff and define what ever your looking for...
:nAn:
Frame3D proc hDC:DWORD,btn_hi:DWORD,btn_lo:DWORD,
tx:DWORD, ty:DWORD, lx:DWORD, ly:DWORD,bdrWid:DWORD
; --------------------------------
; prototype and example usage code
; --------------------------------
; LOCAL btn_hi :DWORD
; LOCAL btn_lo :DWORD
; invoke GetSysColor,COLOR_BTNHIGHLIGHT
; mov btn_hi, eax
; invoke GetSysColor,COLOR_BTNSHADOW
; mov btn_lo, eax
; invoke Frame3D,hDC,btn_lo,btn_hi,50,50,150,100,2
; invoke Frame3D,hDC,btn_hi,btn_lo,47,47,153,103,2
; --------------------------------
LOCAL hPen :DWORD
LOCAL hPen2 :DWORD
LOCAL hpenOld :DWORD
invoke CreatePen,0,1,btn_hi
mov hPen, eax
invoke SelectObject,hDC,hPen
mov hpenOld, eax
; ------------------------------------
; Save copy of parameters for 2nd loop
; ------------------------------------
push tx
push ty
push lx
push ly
push bdrWid
; ------------
lpOne:
invoke MoveToEx,hDC,tx,ty,NULL
invoke LineTo,hDC,lx,ty
invoke MoveToEx,hDC,tx,ty,NULL
invoke LineTo,hDC,tx,ly
dec tx
dec ty
inc lx
inc ly
dec bdrWid
cmp bdrWid, 0
je lp1Out
jmp lpOne
lp1Out:
; ------------
invoke CreatePen,0,1,btn_lo
mov hPen2, eax
invoke SelectObject,hDC,hPen2
mov hPen, eax
invoke DeleteObject,hPen
; ------------
pop bdrWid
pop ly
pop lx
pop ty
pop tx
lpTwo:
invoke MoveToEx,hDC,tx,ly,NULL
invoke LineTo,hDC,lx,ly
invoke MoveToEx,hDC,lx,ty,NULL
inc ly
invoke LineTo,hDC,lx,ly
dec ly
dec tx
dec ty
inc lx
inc ly
dec bdrWid
cmp bdrWid, 0
je lp2Out
jmp lpTwo
lp2Out:
; ------------
invoke SelectObject,hDC,hpenOld
invoke DeleteObject,hPen2
ret
Frame3D endp
so this is my FRAME3D code ( i used just the example file of MASM (one of them which was included) anyways i just have to replace the color:
invoke GetSysColor,COLOR_BTNHIGHLIGHT
mov btn_hi, eax
into
mov btn_hi, 000000FFh
right ?
tx:DWORD, ty:DWORD, lx:DWORD, ly:DWORD,bdrWid:DWORD
; --------------------------------
; prototype and example usage code
; --------------------------------
; LOCAL btn_hi :DWORD
; LOCAL btn_lo :DWORD
; invoke GetSysColor,COLOR_BTNHIGHLIGHT
; mov btn_hi, eax
; invoke GetSysColor,COLOR_BTNSHADOW
; mov btn_lo, eax
; invoke Frame3D,hDC,btn_lo,btn_hi,50,50,150,100,2
; invoke Frame3D,hDC,btn_hi,btn_lo,47,47,153,103,2
; --------------------------------
LOCAL hPen :DWORD
LOCAL hPen2 :DWORD
LOCAL hpenOld :DWORD
invoke CreatePen,0,1,btn_hi
mov hPen, eax
invoke SelectObject,hDC,hPen
mov hpenOld, eax
; ------------------------------------
; Save copy of parameters for 2nd loop
; ------------------------------------
push tx
push ty
push lx
push ly
push bdrWid
; ------------
lpOne:
invoke MoveToEx,hDC,tx,ty,NULL
invoke LineTo,hDC,lx,ty
invoke MoveToEx,hDC,tx,ty,NULL
invoke LineTo,hDC,tx,ly
dec tx
dec ty
inc lx
inc ly
dec bdrWid
cmp bdrWid, 0
je lp1Out
jmp lpOne
lp1Out:
; ------------
invoke CreatePen,0,1,btn_lo
mov hPen2, eax
invoke SelectObject,hDC,hPen2
mov hPen, eax
invoke DeleteObject,hPen
; ------------
pop bdrWid
pop ly
pop lx
pop ty
pop tx
lpTwo:
invoke MoveToEx,hDC,tx,ly,NULL
invoke LineTo,hDC,lx,ly
invoke MoveToEx,hDC,lx,ty,NULL
inc ly
invoke LineTo,hDC,lx,ly
dec ly
dec tx
dec ty
inc lx
inc ly
dec bdrWid
cmp bdrWid, 0
je lp2Out
jmp lpTwo
lp2Out:
; ------------
invoke SelectObject,hDC,hpenOld
invoke DeleteObject,hPen2
ret
Frame3D endp
so this is my FRAME3D code ( i used just the example file of MASM (one of them which was included) anyways i just have to replace the color:
invoke GetSysColor,COLOR_BTNHIGHLIGHT
mov btn_hi, eax
into
mov btn_hi, 000000FFh
right ?
Use GetWindowLong/SetWindowLong with GWL_WNDPROC to subclass. Make sure you save the old procedure returned by SetWindowLong and call it in the START of your own window procedure with CallWindowProc.