CookCookie
CookCookie

Reputation: 55

What's the update area of UpdateLayeredWindowIndirect function?

I'm trying to update a rectangle area of a layered window using UpdateLayeredWindowIndirect function, but I get confused when I read the doc.

According to the doc of UpdateLayeredWindowIndirect,

UpdateLayeredWindowIndirect always updates the entire window. To update part of a window, use the traditional WM_PAINT and set the blend value using SetLayeredWindowAttributes.

However the second parameter pULWInfo contains a member prcDirty which seems to be used to update a certain area instead of the whole window,

The area to be updated. This parameter can be NULL. If it is non-NULL, only the area in this rectangle is updated from the source DC.

These two descriptions seem contradictory to me. Are they referring to different steps of updating a layered window? What is the mechanism behind this function? And What's the difference if I try to update asynchronously by handling WM_PAINT instead?

Upvotes: 0

Views: 203

Answers (1)

Eric Brown
Eric Brown

Reputation: 13942

I believe it's a documentation bug. It looks like the documentation for UpdateLayeredWindowIndirect copied most of the info from UpdateLayeredWindow; however, UpdateLayeredWindow doesn't have a dirty rectangle parameter. Therefore, the comment would be correct for UpdateLayeredWindow but incorrect for UpdateLayeredWindowIndirect.

Upvotes: 2

Related Questions