Re: BitBlt Bitmap to Region ???
"cdg" <anyone@anywhere.com> wrote in message
news:JGali.164370$Sa4.12564@bgtnsc05-news.ops.worldnet.att.net...
Could anyone help me with the code for using a bitmap as the background
for a dialog. I had thought that the code below would be the right
approach,
but I am having a problem with removing the titlebar from a Round
Rectangle
Region after BitBlt-ing a bitmap.
This code is is in OnInitDialog() -
rgnRoundRect.CreateRoundRectRgn( 0, 0, 400, 400, 23, 23 );
SetWindowRgn(rgnRoundRect,true);
DeleteObject(rgnRoundRect);
I don't think setting a window region has anything to do with removing the
titlebar (btw, the titlebar is part of the HWND, not the HRGN).
Anyway, the error I saw is that you should not call
DeleteObject(rgnRoundRect), as MSDN says:
--- begin MSDN
After a successful call to SetWindowRgn, the system owns the region
specified by the region handle hRgn. The system does not make a copy of the
region. Thus, you should not make any further function calls with this
region handle. In particular, do not delete this region handle. The system
deletes the region handle when it no longer needed.
---
-- David