Click to See Complete Forum and Search --> : The background gets dirty.


a_fischetti
June 18th, 1999, 02:57 AM
I want to make a program which consists just of a bmp with a transparent background.
Like that funny program which shows a sheep on the screen.
I don't want to use MFC.
The problem is that the background of my bmp behaves as if it gets printed by the other windows! If it is uncovered by another overlapping window, it keeps a copy in the background of the covering window.
I created a window with a transparent background setting

wc.hbrBackground = 0



and I processed in my window procedure the msg WM_ERASEBKGND

.elseif uMsg == WM_ERASEBKGND
invoke GetDC, hWin
mov hDCmainwnd, eax
invoke CreateCompatibleDC, hDCmainwnd
mov hDCmem, eax
invoke SelectObject, hDCmem, hBmp
invoke BitBlt, hDCmainwnd,1,1,103,49,hDCmem, 0, 0, SRCAND
invoke ReleaseDC, hWin, hDCmainwnd
invoke DeleteDC, hDCmem
return 1



Anyone can help me please? Thanks in advance.

_______