How do I grab the screen contents referred to by an hDC?

Bill Medland billmedland at look.ca
Mon Aug 26 13:32:58 CDT 2002


Can anyone tell me how I can do this; I am trying to debug a problem with
user32.dll under the native NT comctl32.?

When drawing a ListView --debugmsg +relay shows three consecutive calls;

SetRect (&rect...)
FillRect (00000b04,&rect,00000082 (/* I reckon that is
GetStockObject(BLACK_BRUSH)*/)
DrawIcon (00000b04,0x40,0x60,hicon,...)

Now as it stands I get random rubbish in the background of the icons (in the
region covered by the mask).

If I insert a hack into DrawIcon so that it does a FillRect (b04,the
rectangle, GetStockObject (WHITE_BRUSH)) then things work out OK.

(Also, the code seems to draw the icon to four hDCs and I can do the same
hack on the second hDC to get the same effect but not the third and fourth).

Firstly I don't understand how it has a chance of working given that it
fills the rectangle with a black brush.

So what I want is a way of seeing what the contents of the rectangular
region is at the exit from the FillRect and the entrance to the DrawIconEx,
based on the hDC.  (Something like "give me the pixels of the 32x32
rectangle at this location of this hDC")

Also it seems to me that these two function calls are consecutive, so if
anything is changing I guess it would be as a result of code within comctl32
itself.  Is there any other way that control can come back into the Wine
code between a relay exit and entrance?

Bill






More information about the wine-devel mailing list