HOWTO: Use GetUpdateRgn()

ID: 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 : kbNTOS kbGrpUser kbWinOS kbWndw kbWndwProp
Version : WINDOWS:3.1
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: December 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.