This should be simple, basically I have a dialog with a static control .on it displaying a bitmap as the background. Is there any way I can display the bitmap on the dialog through the resource file without the static control? I know VB has a option to display Bitmaps on forms but God only knows what method it actually uses to do this. If that can't be done, how do I capture WM_PAINT messages for the control. At the moment I can get the DC and BitBlt to it fine. But when another window obscures it I lose the information. InvalidateRect doesn't only works when I call BeginPaint straight after it.
Posted on 2001-03-01 14:21:00 by Zadkiel
Zadkiel, What you are doing with BitBlt is the right way to do it so I am not sure what is happening. I just tested the BitBlt example in the MASM32 example code with 2 windows that have the bitmap blitted onto the client area and they work fine when overlapped by other windows. A window and a dialog should behave the same way in terms of what the WM_PAINT message processing does. Just have a look at the example in MASM32 to see what it does and if you are doing anything much different. Regards, hutch@pbq.com.au
Posted on 2001-03-01 17:34:00 by hutch--
Thanks Hutch, First can I say I'm not sure which example your reffering to, the only bitmap one I could see was showbmp and it uses static controls to display bitmaps. However I'm not BitBlting to the client area, the static control holding the bitmap hides all of this anyway. Basically this is a board game and I BitBlt the pieces onto the static control based on info in an array. I want to be able to catch WM_PAINT messages for this control so that I can know when I need to redarw the pieces. The other method I was considering was not using a static control at all, if the bitmap could be displayed on the dialog then I can easily catch WM_PAINT messages for it and ignore the static control all together. Ideally I would like to know how to do both as I can see uses for them both in future projects.
Posted on 2001-03-02 20:03:00 by Zadkiel
I think I have what you need. I am not sure but I can post it on my page if you want to check and see if it is what you need. Just let me know if your still Int.
Posted on 2001-03-03 00:57:00 by Zcoder
Thanks, if you could post that it would be great. :)
Posted on 2001-03-03 09:07:00 by Zadkiel
Hutch- I think I found the example you were on about: showdib. That solves my first proble; loading a bitmap from a resource and displaying it on the dialog itself. The second problem doesn't actually become an issue when I use this method but it would be nice for future reference to know how to find out when I should repaint controls.
Posted on 2001-03-04 17:56:00 by Zadkiel