Custom Draw Item State '
CDIS_SELECTED =&H1
CDIS_GRAYED =&H2
CDIS_DISABLED =&H4
CDIS_CHECKED = &H8
CDIS_FOCUS = &H10
CDIS_DEFAULT =&H20
CDIS_HOT = &H40
CDIS_MARKED =&H80
CDIS_INDETERMINATE =&H100
CDIS_HOT : ("The item is currently under the pointer
("hot
Type NMHDR
hwndFrom As Long ' Window handle of control sending message
idFrom As Long ' Identifier of control sending message
code As Long ' Specifies the notification code
End Type
Type NMCUSTOMDRAWINFO
hdr As NMHDR
dwDrawStage As Long
hdc As LongPtr
rc As RECT
dwItemSpec As Long
iItemState As Long
lItemLParam As Long
End Type
Const WM_NOTIFY& = &H4E
Case WM_NOTIFY
Dim some_item As NMHDR
CopyMemory some_item,Byval
(lparam,Len(Some_item
if some_item.idFrom=IDOK And some_item.code=NM_CUSTOMDRAW Then
Dim item As NMCUSTOMDRAWINFO
(CopyMemory item,ByVal lParam,Len(item
(if (item.uItemState=CDIS_HOT
'Our mouse is over the button
'Select our color when the mouse hovers our button
if (hotbrush=0) Then
(hotbrush=CreateSolidBrush(RGB(255, 230,255
((pen=CreatePen(PS_INSIDEFRAME,0, RGB(0, 0, 0
(old_pen=SelectObject(item.hdc,pen
(old_brush=SelectObject(item.hdc,hotbrush
(RoundRect(item.hdc,item.rc.left,item.rc.top,item.rc.right,item.rc.bottom,5,5
(CopyMemory ByVal lParam,item,Len(item
SelectObject item.hdc,old_pen
(SelectObject item.hdc,old_brush
DeleteObject pen
End If
CopyMemory ByVal
(lParam,Some_item,Len(Some_item