Desktop paints order backwards

From: Gili (sittingduck_at_bbs.darktech.org)
Date: 04/28/04


Date: 28 Apr 2004 11:58:31 -0700

Hi,

   I added two message-listeners (through subclassing) to the Progman
and SysListView32 windows. Here is what I observe:

(SysListView32) message=WM_PAINT,wParam=0, lParam=0,return=0
(SysListView32) message=WM_NCPAINT,wParam=0, lParam=0,return=0
(SysListView32) message=WM_ERASEBKGND,wParam=0, lParam=0,return=0
(SysListView32) message=LVM_GETBKCOLOR,wParam=0, lParam=0,return=0
(Progman) message=WM_ERASEBKGND,wParam=0, lParam=0,return=0

    What I see is that SysListView32 paints the desktop icons *before*
Progman draws the desktop wallpaper. This makes no sense to me since
the Progman window is located below SysListView32 and one needs to
draw the wallpaper *before* the icons. I know that somehow the DC
passed to Progman WM_ERASEBKGND refers to the background of
SysListView32 and this paints *under* the icons but this makes no
sense to me since painting is occuring *after* icons have been drawn.

    Can anyone please explain to me how this works? The reason I ask
is that I am creating a new DC inside Progman's WM_ERASEBKGND handler
and when I paint to it it is painting over the icons (as expected) but
I want it too to draw under the icons like the HDC passed in through
wParam.

Please help,
Gili Tzabari



Relevant Pages

  • Re: Drawing of PNGs with transparent pixels
    ... ImageList.Draw() to draw the image instead of Graphics.DrawImage. ... To enable icons in menus, ... > image to a PictureBox control. ... > What seems unlogical to me is that other controls like ToolBarButton draw ...
    (microsoft.public.dotnet.framework.drawing)
  • Painting to Progman desktop
    ... WM_ERASEBKGND for the ProgMan desktop for the following reasons (skip ... it seems the SysListView32 has no background image. ... Even if I override the SysListView32 background it doesn't work as ... ProgMan window, it fails. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Aaarrrggghhh -- that ugly flicker!
    ... USE BUFFERED DRAW ... | I constructed a "fake" statusbar, using a picbox aligned to the bottom of my ... | the icons from a system dll, and used an Image controlto display them. ... | time the statusbar is updated, the icon in the Image control will "flicker". ...
    (microsoft.public.vb.general.discussion)
  • Re: Aaarrrggghhh -- that ugly flicker!
    ... USE BUFFERED DRAW ... | I constructed a "fake" statusbar, using a picbox aligned to the bottom of my ... | the icons from a system dll, and used an Image controlto display them. ... | time the statusbar is updated, the icon in the Image control will "flicker". ...
    (microsoft.public.vb.winapi)
  • Re: Image Editor tool bar
    ... you can override the OnPaint procedure and make your ... > question but I just don't know how to draw a simple line ... In a design mode I made the image editor tool ... > bar to display but all the icons are disable. ...
    (microsoft.public.vsnet.general)