10

What are the differences between RedrawWindow and UpdateWindow in Win32?

Since they seem to have the same purpose to refresh a window, what are the differences?

jondinham
  • 8,271
  • 17
  • 80
  • 137

1 Answers1

12

RedrawWindow is typically used to force a redraw of the entire window (or some specified region within) right now.

UpdateWindow will force a redraw of only the update region of the window, i.e. that part of the window that has been invalidated (e.g. by calling InvalidateRect) since the last paint cycle.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • So, what's the difference between a single call to `RedrawWindow`, and a call to `InvalidateRect` followed immediately by a call to `UpdateWindow`? – Cody Gray - on strike May 30 '12 at 07:11
  • 3
    @Cody `RedrawWindow` can also force a repaint of the non-client area of a window (`RDW_FRAME`). `UpdateWindow` only updates the intersection between the update rectangle and the client area. – IInspectable Apr 09 '14 at 07:46