Hello Everybody,
I'm using CreateCompatibleDC and StetchBlt to resize bitmaps on my dialog boxes. This all works great and bitmaps are correct size and location when I change font size.
I process the WM_PAINT message and pass dc and parameters to my proc.
The problem is when the dialog box is hidden then re-activated only the two bitmaps are visible - all the controls are gone until I drag the dialog box. Then they re-appear.
I've tried InvalidateRect but this doesn't seem to work. Any suggestions welcome.
best regards,
czDrillard
I'm using CreateCompatibleDC and StetchBlt to resize bitmaps on my dialog boxes. This all works great and bitmaps are correct size and location when I change font size.
I process the WM_PAINT message and pass dc and parameters to my proc.
The problem is when the dialog box is hidden then re-activated only the two bitmaps are visible - all the controls are gone until I drag the dialog box. Then they re-appear.
I've tried InvalidateRect but this doesn't seem to work. Any suggestions welcome.
best regards,
czDrillard
I think you have to process the WM_SIZE message to redraw your alterations.
Raymond
Raymond
Did you remember to call BeginPaint and EndPaint?
To Sephiroth3,
Yes I call begin Paint then my proc then end paint. I didn't want to do it this way but I needed the dc from begin paint. I wanted to do all this under WM_INITDIALOG message but don't know how to get a dc that I can paint on.
To Raymond,
How do I get a DC when processing WM_SIZE? GetDC doesn't seem to work with StrechBlt function.
Thanks for your replies.
best regards,
czDrillard
Yes I call begin Paint then my proc then end paint. I didn't want to do it this way but I needed the dc from begin paint. I wanted to do all this under WM_INITDIALOG message but don't know how to get a dc that I can paint on.
To Raymond,
How do I get a DC when processing WM_SIZE? GetDC doesn't seem to work with StrechBlt function.
Thanks for your replies.
best regards,
czDrillard
Hi :)
My 0.02: I think you should call GetDC or GetWindowDC for that. There should be no problems using StretchBlt... maybe the problem is somewhere else? (Passing wrong parameters somewhere).
Posted on 2003-11-12 20:00:34 by QvasiModo
My 0.02: I think you should call GetDC or GetWindowDC for that. There should be no problems using StretchBlt... maybe the problem is somewhere else? (Passing wrong parameters somewhere).
Posted on 2003-11-12 20:00:34 by QvasiModo
As QvasiModo suggested, you can probably call GetDC when processing the WM_INITDIALOG message. If that is correct, make sure to keep the return value in a global variable.
Raymond
Raymond