hi,
i was wondering if there was a good way to rePaint the selection bar with other color rather than blue?
for example to change the blue selection bar of a selected item in a listview.
i tried something out but i guess it will paint all items and without the text :(
and it turns out really ugly ..



;on the customDraw message (NM_CUSTOMDRAW):
.IF uMsg == WM_NOTIFY
MOV ESI,lParam
ASSUME ESI:PTR NMLISTVIEW

.IF [ESI].hdr.hwndFrom == hList && [ESI].hdr.code == NM_CUSTOMDRAW
invoke SetWindowLong,hWnd,DWL_MSGRESULT,OFFSET ProcessCustomDraw
MOV EAX,1
.ENDIF

.ELSEIF ...

; Custom proc handler
ProcessCustomDraw PROC lParam:LPARAM
LOCAL m_color:COLORREF
LOCAL m_brush:HBRUSH
LOCAL m_rc:RECT

MOV ESI,lParam
ASSUME ESI:PTR NMLVCUSTOMDRAW


.IF [ESI].nmcd.dwDrawStage == LVIS_FOCUSED or LVIS_SELECTED
RGB 255,0,0
invoke CreateSolidBrush,EAX
MOV m_brush,EAX
MOV m_rc,DWORD PTR [ESI].nmcd.rc
invoke SelectObject,[ESI].nmcd.hdc,m_brush
invoke FillRect,[ESI].nmcd.hdc,addr m_rc,m_brush
invoke DeleteObject,m_brush
.ENDIF

RET
ProcessCustomDraw endp

thnx,
Posted on 2003-08-25 07:10:10 by wizzra
i get this
Posted on 2003-08-25 07:16:23 by wizzra
check this thread and download an example.
Posted on 2003-08-25 09:54:29 by NEMO