Im working on a project that contains a status bar and would like to match the colors of it along with all the other colors of the proggie (black bg with 0FF8000h text or babyblue). Anyway, I know how to change the bg color but can't change the text color. any help on this? I have already d/led the example on radasm site (ODstatusBar i think?). Was wondering if there is like some kind of api I could use/send to status bar (ex. SB_SETTEXTCOLOR) to change the color.. Any help is appreciated.
RIF
RIF
You have to do an owner draw. Status bars have individual parts and each has to be set to owner draw with the SB_SETTEXT message. Then you have only to fill it with a color, draw the border and text in response to a WM_DRAWITEM message. Simple as that ;)
WMINITDIALOG:
invoke SendDlgItemMessage,[hwnd], 1002, SB_SETTEXT, SBT_OWNERDRAW, 0
jmp >>.EXIT
WMDRAWITEM:
mov edi,[lParam]
cmp D[edi+DRAWITEMSTRUCT.CtlID], 1002 ; status bar
jne >>.EXIT
invoke CreateSolidBrush, 00FF0000h ; back color
mov ebx,eax
mov esi,edi
add esi, DRAWITEMSTRUCT.rcItem
invoke FillRect, [edi+DRAWITEMSTRUCT.hdc], esi, ebx
invoke DeleteObject,ebx
invoke DrawEdge, [edi+DRAWITEMSTRUCT.hdc], esi, BDR_SUNKENINNER, BF_RECT
invoke SetTextColor, [edi+DRAWITEMSTRUCT.hdc], 000000FFh ; Text color
invoke SetBkMode, [edi+DRAWITEMSTRUCT.hdc], TRANSPARENT
invoke DrawText, [edi+DRAWITEMSTRUCT.hdc], "Hello", 5, esi, \
DT_LEFT + DT_SINGLELINE + DT_VCENTER
jmp >.EXIT