user965369
user965369

Reputation: 5743

Using UpdateLayeredWindow on a region of a window

I'm using UpdateLayeredWindow to create a layered window, and I've implemented drawing logic for the child controls. My problem is that every time a change occurs to the uI, the whole frame needs to be redrawn. I wondered if there was a way to only redraw a specific CRect or CRgn of the window (ie, passing the relevant CDC into UpdateLayeredWindow, but specifying the CRect you want to be invlidated).

Would using UpdateLayeredWindowIndirect, and setting the prcDirty CRect in the UPDATELAYEREDWINDOWINFO struct, to the client area of the control, cause an update of only that area?

Upvotes: 5

Views: 2005

Answers (3)

Jurlie
Jurlie

Reputation: 1014

Would using UpdateLayeredWindowIndirect, and setting the prcDirty CRect in the UPDATELAYEREDWINDOWINFO struct, to the client area of the control, cause an update of only that area?

Yes. This is exactly what it does.

Upvotes: 0

Raymond Chen
Raymond Chen

Reputation: 45172

The psize and pptSrc parameters let you specify what portion of the window you want to update. UpdateLayeredWindow does not use an invalidation model. It uses an update model.

Upvotes: 4

Logan Capaldo
Logan Capaldo

Reputation: 40356

"UpdateLayeredWindow always updates the entire window. To update part of a window, use the traditional WM_PAINT and set the blend value using SetLayeredWindowAttributes." - http://msdn.microsoft.com/en-us/library/windows/desktop/ms633556(v=vs.85).aspx

Please read the docs. Pleeeeease.

Upvotes: 0

Related Questions