G
Ein kleines Beispiel.
Das Parent-Fenster ist mit einem horizontalen Farbverlauf gefüllt.
Das Child-Fenster soll das selbe Füllmuster benutzen und somit "unsichtbar" erscheinen.
Hier die WM_PAINT des Child-Fensters:
;//////////////////////////////////////////////////////////////////////////
;//
;// Handle WM_PAINT message
;//
OnPaint _PROC FRAME uses rdi, lpcs:LPCOOLSPLITBAR, hwnd:HWND, wParam:WPARAM, lParam:LPARAM
LOCAL hdc: HDC
LOCAL hBrush: HBRUSH
LOCAL pt: POINT
LOCAL rcSplit: RECT
LOCAL rcParent: RECT
LOCAL ps: PAINTSTRUCT
mov rdi, rcx
mov hdc, BeginPaint (hwnd, &ps)
;//
;// Paint the background of the splitter window
;//
;// Calculate the splitter window position relative to
;// the parent window and adjust the brush origins
GetWindowRect ((COOLSPLITBAR ptr [rdi]).hwnd, &rcSplit)
GetWindowRect ((COOLSPLITBAR ptr [rdi]).hwndParent, &rcParent)
mov edx, INT_ ptr rcParent.right
sub edx, INT_ ptr rcSplit.left
SetBrushOrgEx (hdc, edx, 0, &pt)
;// Fill the client area using the background brush
FillRect (hdc, &ps.rcPaint, g_hbrThemeBkGrnd)
;// Restore the brush origins
SetBrushOrgEx (hdc, pt.x, pt.y, NULL)
EndPaint (hwnd, &ps)
xor rax, rax
OnPaint _ENDP
LG
Greenhorn