Microsoft KB Archive/99047

{|
 * width="100%"|

HOWTO: Use GetUpdateRgn

 * }

Q99047

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) 3.1

-

SUMMARY
The documentation provided with the Microsoft Windows Software Development Kit (SDK) for Microsoft Windows version 3.1 does not address all the issues surrounding the use of the GetUpdateRgn function. This article complements the documentation of GetUpdateRgn.

MORE INFORMATION
The handle to the region (hRgn) does not have to be selected into a device context (DC) to be able to use it with GetUpdateRgn. Even if the hRgn is selected as the clipping region for a DC, Windows only makes a copy of the hRgn for the hDC instead of using the hRgn directly.

When hRgn is used with GetUpdateRgn, Windows will ignore any existing region in hRgn. It will replace any existing region with the current update region of the window.

Calling GetUpdateRgn soon after BeginPaint always yields an empty region because BeginPaint validates the update region.

A typical Windows query function (functions that typically begin with Get and Is) does not initiate any action. GetUpdateRgn is not a typical function in this respect. The third parameter, fErase, works as advertised to initiate a repaint on request.

Additional query words:

Keywords : kbOSWinNT kbGrpDSUser kbOSWin kbWndw kbWndwProp

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK310