INTRODUCTION AND RELATED INFORMATION:
I have a complicated picture to implement in my main WM_PAINT window.
I presented the image below to illustrate this:

The main window has static controls, not buttons with the SS_NOTIFY style.
When the user clicks on them, certain actions take place in the program.
The following figure shows which static controls are in the main window:

The map on the orange panel is an EMF file, the top left and right logos are PNG files, and other images are bitmap images.
To implement this task, I decided to draw the whole picture in WM_PAINT and put invisible static image controls on the image that corresponds to them.
Therefore, I only return NULL_BRUSH in the WM_CTLCOLORSTATIC handler as follows:
case WM_CTLCOLORSTATIC: return (LRESULT)( (HBRUSH)GetStockObject(NULL_BRUSH) );
I am working on Windows XP using the MS Visual Studio C++ 2008 Express Edition and the pure Win32 API .
One note : since Express VS does not have one , the resource editor, resource file and resource header were created using ResEdit from here: http://www.resedit.net/ .
Problem:
When I resize the window, the static controls flicker slightly.
MY EFFORTS TO SOLVE THE PROBLEM:
I processed WM_ERASEBKGND (returned (LRESULT)1 ), and I excluded the CS_VREDRAW and CS_HREDRAW from my window class, so this should not cause flickering.
There is no WS_CLIPCHILDREN style in my window.
EDIT: In response to the comment below, I will explain why this window does not have this style set:
The problem is that part of the desktop image is visible where static controls are installed.
I implemented double buffering for both handlers to avoid flickering.
I used the GDIView tool downloaded here: http://www.nirsoft.net/utils/gdi_handles.html to track the GDI leaks .
Every time I resize the window, GDIView shows +4 in the column for regions, which means that I am leaking regions.
I cannot understand how this is possible, since I do not use APIs that manipulate regions.
To illustrate what I came across, I made a demo application with detailed comments: http://www.filedropper.com/geotermistgrafika
I believe this is a more efficient way and then send the code as it will consume too much space.
Question:
How can I change the code in a demo project to get rid of the flicker?
Is my approach wrong, and if so, which one is right?
Thanks. Best wishes.