Partager via


Using a Clipper with Multiple Windows

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

You can use a DirectDrawClipper object to blit to multiple windows created by an application running at the normal cooperative level.

To do this, create a single DirectDraw object with a primary surface. Then, create a DirectDrawClipper object and assign it to your primary surface by calling the IDirectDrawSurface::SetClipper method.

To blit only to the client area of a window, set the clipper to that window's client area by calling the IDirectDrawClipper::SetHWnd method before blitting to the primary surface.

Whenever you need to blit to another window's client area, call the IDirectDrawClipper::SetHWnd method again with the new target window handle.

Creating multiple DirectDraw objects that blit to each others' primary surface is not recommended. The technique just described provides an efficient and reliable way to blit to multiple client areas with a single DirectDraw object.