Re: Problem with GDI and Aero
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 04 Aug 2008 11:48:07 -0400
See below...
On Mon, 4 Aug 2008 09:31:44 +0200, "Erwan" <Erwan@xxxxxxxxxx> wrote:
****
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> a écrit dans le message de
news: 1kj3949144its42p25u56g601dsftcpmi2@xxxxxxxxxx
The whole sequence is suspect. If you are drawing a bitmap inside a
dialog box, you would
be doing it int he OnPaint handler, which means there is no reason to call
GetDC. So what
is the purpose of GetDC? What is the purpose of
ClientToScreen/ScreenToClient? Why in
the world are you doing GetDlgItem? If the bitmap is being drawn in a
static control,
then the static control's WM_PAINT handler is where you should be doing
the work; it makes
no sense to have the dialog draw into a child control. I'd suggest fixing
the code so it
is in the correct place doing the correct thing before trying to figure
out why Aero is
defeating it; I suspect the reason it doesn't work is that the code is
flat-out wrong, and
Aero does not support having a parent do random drawing on the surface of
a child control
(a paradigm so unnatural that Aero probably refuses to support it)
The correct code would be in the WM_PAINT handler for the child control in
which you are
drawing, and would be
BeginPaint
LoadBitmap
GetObject
GetClientRect
CreateCompatibleDC
SelectObject
BitBlt
EndPaint
or, actually, choose a static control with the SS_BITMAP style and just do
SetBitmap to it
and the default behavior is that it will draw itself!
joe
Joe,
I changed Begin/End Paint and the drawing of the static area from the parent
control, and now it works fine under Aero.
I can't use SetBitmp because it's native Windows api, not mfc.
Then use the STM_SETIMAGE message! (RTFM helps a lot. I went to Static Controls, and
looked at the list of possible messages, and there it was. After all, that's all
SetBitmap does in MFC!)
joe
****
.
Thanks for your help.
- References:
- Re: Problem with GDI and Aero
- From: Erwan
- Re: Problem with GDI and Aero
- Prev by Date: Re: Problem with GDI and Aero
- Next by Date: Re: Drawing an icon so that a particular color is transparent
- Previous by thread: Re: Problem with GDI and Aero
- Next by thread: Can you send uppercase Chars to Terminal Server ?
- Index(es):
Relevant Pages
|