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 3227244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:33:06+00:00 2026-05-17T16:33:06+00:00

Okay, so in my application, there are a bunch of winAPI and a few

  • 0

Okay, so in my application, there are a bunch of winAPI and a few custom controls. Yay…

Now, normally, they will just quietly redraw themselves for animations, state changing, ect…. and it all works fine.

But I have a method of class Window called fix(). This is called whenever the whole window needs to be updated. It resizes the controls and invalidates the window.

When this happens, the background is drawn, then the tab control, then all the others on top. This causes very irritating blinking, especially when resizing the window (because of constant calls to fix()).

What I have tried:

  • WS_EX_COMPOSITED. This only double-buffers the individual controls. Its an improvement, but the flickering inevitably remains.
  • Turning off background drawing. Hardly solves the problem, and actually makes matters worse.

So: I need a technique/method/whatever to allow me to double-buffer the window in its entirety. I figured that handling the WM_PAINT message by myself might be a solution, but I wouldn’t know where to begin. I have a horrible feeling this isn’t even possible…

Please help, this is a critical issue. I will be very relieved when this stupid little issue is fixed.

  • 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-05-17T16:33:07+00:00Added an answer on May 17, 2026 at 4:33 pm

    It is at this time that one realized the depths of Microsofts disregard for native developers. One could in fact start to harbor paranoid delusions that Microsoft has purposely broken native painting in order to force native developers to move to WPF.

    First, consider WS_EX_COMPOSITED. WS_EX_COMPOSITED seems to be the mustard :- it says that it enforces a botton to top paint order for child controls, and basically that WM_PAINT messages get handled in a batch. It says it was added in Windows 2000 (5.0) and, a few lines down, that it does not work with desktop composition enabled. i.e. It stops working as of Windows Vista (6.0), unless aero glass is turned off and who is going to do that?

    Then, there are two possible “hacks” to try and get flicker free painting to work:

    • First, you need to mimimize the amount of overpainting. WS_EX_CLIPCHILDREN | WS_EX_CLIPSIBLINGS are necessary to ensure that any particular area of the window is only painted once. BeginDeferWindowPos is also necessary to batch up resizing operations to ensure that transient states – where one window overlaps another – don’t happen (i.e. when Window A has been resized but Window B has not).

    Of course, when you are trying to draw a skinned dialog, or use Group boxes, or tab controls, or any number of other restrictions, WS_EX_CLIPSIBLINGS is just not appropriate.

    • WM_SETREDRAW is a magic message. There is no API to access this functionality: WM_SETREDRAW is directly handled by DefWindowProc to essentially mark the window as hidden for the duration. After WM_SETREDRAW, FALSE is sent, calls to GetDC/GetDCEx/GetWindowDC etc using the parent window handle (and all its children) will return a DC that won’t draw on the screen. This gives you a chance to do all kinds of stuff to the child windows, when you are done send a WM_SETREDRAW,TRUE, (and then repaint the window manually). All the child windows will – of course – paint in their own time, and after the parent window has done its erase background, so WM_SETREDRAW is no kind of panacea.

    After breaking WS_EX_COMPOSITED, In .NET’s WinForms and WPF re-wrote the controls from the ground up to not use the native controls, so they could bake in buffered painting there. And alpha support too.

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

Sidebar

Related Questions

Okay, so I'm developing an application that will allow users to select file objects
Okay.. I am making a web base application,that will be connected to a sms
Okay I have an extensive ruby application running behind Ruby on Rails right now.
All I want to do, If there is nothing on UITextField , application will
I have some serious problems with my app right now. Okay, so there are
Is there a distributed application framework (commercial is okay as well) that supports iPhone
Okay so I want to make an application that launches other applications. However, the
Okay, I have a WebBrowser control in my VB.NET application that loads a PHP
In my Rails application there are some metrics about the content of the database
Okay I have created an application where in one of the screens I have

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.