Re: Problem with GDI and Aero



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.


.



Relevant Pages

  • Re: Problem with GDI and Aero
    ... then the static control's WM_PAINT handler is where you should be doing ... no sense to have the dialog draw into a child control. ... out why Aero is ... or, actually, choose a static control with the SS_BITMAP style and just ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Problem with GDI and Aero
    ... be doing it int he OnPaint handler, which means there is no reason to call ... no sense to have the dialog draw into a child control. ... out why Aero is ... or, actually, choose a static control with the SS_BITMAP style and just do ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Custom Control - Notifcation Messages
    ... 'The function CWnd::OnNotify handles notification messages. ... Instead, you provide a handler ... Notify the parent. ... I just didn't realize that WM_NOTIFY was control specific. ...
    (microsoft.public.vc.mfc)
  • Re: How can I stop controls from executing default keyboard and mouse behavior?
    ... > acted upon even if the Ctrl keys were also being pressed. ... If the grid is not really "on" the page control, ... > handler needed if you press up arrow or down arrow when it has focus. ...
    (alt.comp.lang.borland-delphi)
  • Re: VS 2005 : why is the default for AutoEventWireup different for C# and VB.NET ?
    ... dim withevents mycontrol as new Control ... '* declare handler - the handles clause link the event to the contol ... > different way than another .Net language is a bit more difficult to ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast