Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8447077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:05:48+00:00 2026-06-10T10:05:48+00:00

From the MSDN documentation: The BeginPaint function validates the entire client area. The ValidateRect

  • 0

From the MSDN documentation:

The BeginPaint function validates the entire client area.

The ValidateRect function should not be called if a portion of the
update region must be validated before the next WM_PAINT message is
generated.1

I’ve been programming with Win32 API for years, and I’ve never thought to call the ValidateRect function. A co-worker of mine today pointed that we were missing a call to ValidateRect, which fixed a bug we were having doing some high-speed animation using GDI (I know, an oxymoron)

Can someone tell me whether or not a call to ValidateRect is necessary after a BeginPaint/EndPaint pair? I have seen no documentation at MSDN that sheds light on this, and what documentation and examples I do see suggest that calling ValidateRect is not necessary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:05:50+00:00Added an answer on June 10, 2026 at 10:05 am

    It’s not necessary. BeginPaint is used when you are validating the area because you handled it (painted it) in WM_PAINT.

    ValidateRect is more to “cancel invalidation”, usually after painting directly on the window without WM_PAINT or because something changed and you no longer want to be issued a pending WM_PAINT.

    The fact that it fixed a bug likely means there’s something else going on, and this accidentally fixed it (maybe by reducing the number of WM_PAINT messages?), or wrong observations (for example you changed 2 things but this one got the attention instead of the other which is the actual fix).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Description for Assert.Equals() from the MSDN Documentation: Do not use this method. That's it,
It is unclear to me from the MSDN documentation if I should provide a
From the documentation here http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login.layouttemplate.aspx i had customized the user interface of login control
From MSDN document i understand ( I am not sure,i understand perfectly ) :
From MSDN documentation, it seems as both GetHashCode() and Equals() haven't been overriden in
I know which languages the OS is available in from the MSDN documentation but
The MSDN documentation on WebBrowser Customization explains how to prevent new windows from being
I am trying to communicate between two processes. From MSDN Documentation, I came across
HttpServerUtility contains a public function called UrlEncode. It is not a shared function. HttpServerUtility
From the MSDN documentation for the FileInfo.Name property, I see that the data for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.