case WM_PAINT
Dim ps As PAINTSTRUCT ps
hdc =BeginPaint(hwnd,ps)
'fill the window with a color HBRUSH
hbrush=CreateSolidBrush(RGB(33, 33, 33))
FillRect hdc,ps.rcPaint,hbrush
DeleteObject(hbrush)
'get a drawing area
Dim Crect As RECT
GetClientRect hwnd,Crect
Crect.bottom=Crect.top+GetSystemMetrics(SM_CYCAPTION)+ GetSystemMetrics(SM_CYEDGE)*2
'draw a simple win9x style caption (switch out the window text while drawing)
SetWindowText hwnd,CUSTOM_CAPTION
DrawCaption hwnd, hdc, rect,DC_GRADIENT Or DC_TEXT Or DC_ACTIVE Or DC_ICON
SetWindowText hwnd,WINDOW_CAPTION
DC_ACTIVE = 1
DC_SMALLCAP = 2
DC_ICON = 4
DC_TEXT = 8
DC_INBUTTON = 16
DC_GRADIENT = 32
SM_CXSCREEN = 0
SM_CYSCREEN = 1
SM_CXSIZE = 30
SM_CYSIZE = 31
SM_CXFRAME = 32
SM_CYFRAME = 33
SM_CYCAPTION = 4
SM_CXBORDER = 5
SM_CYBORDER = 6
SM_CXICON = 11
SM_CYICON = 12
SM_CXFRAME = 32
SM_CYFRAME = 33
SM_CXEDGE = 45
SM_CYEDGE = 46
DFC_CAPTION = 1
DFC_MENU = 2
DFC_SCROLL = 3
DFC_BUTTON = 4
DFC_POPUPMENU = 5
DFCS_CAPTIONCLOSE = 0
DFCS_CAPTIONMIN = 1
DFCS_CAPTIONMAX = 2
DFCS_CAPTIONRESTORE = 3
DFCS_CAPTIONHELP = 4
DFCS_MENUARROW = 0
DFCS_MENUCHECK = 1
DFCS_MENUBULLET = 2
DFCS_MENUARROWRIGHT = 4
DFCS_SCROLLUP = 0
DFCS_SCROLLDOWN = 1
DFCS_SCROLLLEFT = 2
DFCS_SCROLLRIGHT = 3
DFCS_SCROLLCOMBOBOX = 5
DFCS_SCROLLSIZEGRIP = 8
DFCS_SCROLLSIZEGRIPRIGHT = 16
DFCS_BUTTONCHECK = 0
DFCS_BUTTONRADIOIMAGE = 1
DFCS_BUTTONRADIOMASK = 2
DFCS_BUTTONRADIO = 4
DFCS_BUTTON3STATE = 8
DFCS_BUTTONPUSH = 16
DFCS_INACTIVE = 256
DFCS_PUSHED = 512
DFCS_CHECKED = 1024
DFCS_TRANSPARENT = 2048
DFCS_HOT = 4096
DFCS_ADJUSTRECT = 8192
DFCS_FLAT = 16384
DFCS_MONO = 32768