Monday, May 21st 2018, 7:12am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Date of registration: Nov 30th 2017

Posts: 18


Monday, April 9th 2018, 1:43pm

how to know a window is created completely

I am creating a child window, and in call back function i am setting the background color for that.

WM_PAINT is getting called twice in that case(I am assuming that it is because of default early clipping )
but i want to know when the last WM_PAINT will get called to draw on that particular window.
is there any API to know that. Please let me know.

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 584


Thursday, April 12th 2018, 10:40am


Yes, this is related to early clipping.

Unfortunately, you can't really know how often a WM_PAINT occurs, beacuse it can have several reasons like the number of child windows or if the child windows transparent or not.

But, you can set the WM_CF_LATE_CLIP flag for a specific window. This causes the clipping to be done while inside WM_PAINT and the this message will occur only once. Unfortunately, this will have an impact on the performance.

You can also react on WM_POST_PAINT which will be send to a window right after the last WM_PAINT.