hello ASM coders,

is it posible to change the titlebar into a bmp image?

Posted on 2003-12-04 01:30:47 by coredump
Yes, you can paint into the titlebar during the WM_NCPAINT handler. I have not tested the following but it should get you started...


; Call the def window proc to draw the frame etc...
@@:invoke DefWindowProc,hWin,uMsg,wParam,lParam
invoke GetWindowDC,hWin
mov hDC,eax

; Get the window dimensions
invoke GetWindowRect,hWin, ADDR rect2

; Get the size of the area to draw into
invoke GetSystemMetrics,SM_CXSIZE
mov sizex,eax
invoke GetSystemMetrics,SM_CXBORDER
add sizex,eax
invoke GetSystemMetrics,SM_CXFRAME
mov junkx, eax
add sizex,eax

mov eax,sizex
mov rect.left,eax

invoke GetSystemMetrics,SM_CYFRAME
mov sizey,eax
mov rect.top,eax

; Fill a RECT structure with our sizes
mov eax,rect2.right
sub eax,rect2.left
shl sizex,1
sub eax,sizex
sub eax,junkx
mov rect.right,eax

invoke GetSystemMetrics,SM_CYSIZE
add eax,sizey
mov rect.bottom,eax

; Render the caption here (rect has the size of the
; caption less the buttons and icon)

invoke SelectObject,hDC,eax
invoke ReleaseDC,hWin, hDC
Posted on 2003-12-04 02:25:25 by donkey
Isnt windows XP using this for its style ?? (and Windows Blinds too ? )
Posted on 2003-12-04 05:16:02 by Ranma_at
hi donkey,

Thank you i will review your code...

more power to all...

Posted on 2003-12-05 18:57:00 by coredump