Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

All Gurus! Please Help Me! WM_PRINTCLIENT

0 views
Skip to first unread message

Atif

unread,
Mar 30, 2005, 3:39:05 AM3/30/05
to
I am having a List-View control draw all its content on an off-screen DC
using WM_PRINTCLIENT message. The reason why I am doing this is so that I can
Paint the list-view control manually using my own background and the
list-view content on top of it. My background changes frequently so I have to
redraw the whole control AND I DON'T want to call WM_PRINTCLIENT each time
that happens (its really slow!).

So what I want to do is keep the contents of the List-View control in an
off-screen DC. and Whenever I have to paint the control, I first draw my
background and the list-view contents on top of it. THE PROBLEM is that its
not Blending! The list-view contents completely over-ride my background
(using BitBlt).

I have spent 3 days now trying to figure out a solution to my problem but
have failed. Please Let me Know If you know the answer. I would really
appreciate it!

Best Regards,
Greg

John Carson

unread,
Mar 30, 2005, 9:07:15 PM3/30/05
to
"Atif" <At...@discussions.microsoft.com> wrote in message
news:ECEA541A-31E0-4888...@microsoft.com


If it were me, I would be looking into Custom Drawing the control (though I
have no experience doing that with a list view control). See here

http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/custdraw/custdraw.asp?frame=true

However, if you are to proceed along your current path, it sounds like you
need TransparentBlt. This function has a resource leak on Windows 98, so for
Windows 98 or earlier you need to manufacture your own TransparentBlt using
BitBlt. This article explains how:

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B79212


--
John Carson


Atif

unread,
Mar 31, 2005, 3:15:03 AM3/31/05
to
The problem is the control isn't owned by me. I have subclassed the control
that belonds to another process and I am trying to paint its background, I
don't think custom draw would work for me.

As of your second opinion. The problem that I see with it is that Windows XP
uses alpha-blended icons. Which would look horrible when painted using
TransparentBlt. Do you know any way to do it for alpha-blended icons?

Thanks

Atif

unread,
Mar 31, 2005, 3:15:02 AM3/31/05
to
The problem is the control isn't owned by me. I have subclassed the control
that belonds to another process and I am trying to paint its background, I
don't think custom draw would work for me.

As of your second opinion. The problem that I see with it is that Windows XP
uses alpha-blended icons. Which would look horrible when painted using
TransparentBlt. Do you know any way to do it for alpha-blended icons?

Thanks

Severian

unread,
Mar 31, 2005, 4:06:24 AM3/31/05
to

>The problem is the control isn't owned by me. I have subclassed the control
>that belonds to another process and I am trying to paint its background, I
>don't think custom draw would work for me.

If the listview erases its background in WM_ERASEBKGND, try using that
message to paint it.

>As of your second opinion. The problem that I see with it is that Windows XP
>uses alpha-blended icons. Which would look horrible when painted using
>TransparentBlt. Do you know any way to do it for alpha-blended icons?

Once WM_PRINTCLIENT paints them to your DC, the icons have already
been blended with whatever background the listview has -- the alpha
channel information is gone.

--
Sev

0 new messages