INTRODUCTION AND RELATED INFORMATION:
I have a difficult picture to implement in my main window WM_PAINT handler.
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 that are currently irrelevant.
The following figure shows which static controls are in the main window:

The map on the orange panel is an EMF file, the upper left and right logo is PNG , and other bitmap s images.
Visual Styles activated using the #pragma . I also use GDI+ with GDI .
The project was created as an empty project, and I encoded everything from scratch.
To implement this task, I decided to draw the whole image in WM_PAINT and place a transparent static control on top of the images in the picture that correspond to them.
To keep my code clean and simple, I created functions that implement the above, so my WM_PAINT handler can be as small as possible.
UPDATE # 1 (updated December 17, 2013):
To implement the advice received from the arx member, I am sending one source code that can be compiled and which can reproduce the problem:
#include <windows.h>
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 , it has a resource editor, the resource file and resource header were created using ResEdit from here: http://www.resedit.net/ .
Problem:
To avoid flickering, I used double buffering, which I learned from * Paul Watt's articles on CodeProject, Charles Petzolds Programming Windows 5th edition, and Forgers WIN32.
Theoretically, everything is fine, and my code compiles without errors.
I pasted the code here: http://pastebin.com/zSYT1i8L
My English is not good enough to accurately describe the problems I am facing (all I can say is that the edges of the main window and the static controls redraw โslowlyโ and they flicker), so I created a demo application that demonstrates them: http://www.filedropper.com/geotermistgrafika
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, because part of the desktop image is visible where static controls are installed.
In my WM_SIZE handler, I have:
Moved static controls using the SetWindowPos(...) API and reduced flicker by adding the SWP_NOCOPYBITS flag.
Invalid full window with InvalidateRect( hWnd, NULL, FALSE ) , so this API does not send WM_ERASEBKGND if invalid (third parameter is FALSE ), but even if I try to use TRUE , the effect is the same
I implemented double buffering for the WM_PAINT handler, as in the examples found in the books / articles / tutorials above (doing everything in DC memory and do BitBlt(...) on the DC screen to avoid flickering).
I did not process the WM_SIZING message, not WM_WINDOWPOSCHANGING or WM_MOVING .
I used the GDIView tool ( http://www.nirsoft.net/utils/gdi_handles.html ) to track the GDI leaks .
Each time I resize / enlarge my window, GDIView shows +4 in the column for regions, which should mean that I am leaking regions, but I cannot understand how this is possible, since I do not use APIs that manipulate regions , and double-checked everything.
In my opinion, everything should be fine, and maybe it doesnโt matter, but I just thought to mention it, maybe it is important.
If I add the WS_EX_COMPOSITED style to the main window, performance will not improve.
I tried to find an online example that would help me solve my problem, but all the tutorials are simple and do not cover this type of complex image.
IMPORTANT NOTE:
After my WM_PAINT handler is empty and calls the onPaint function in WM_ERASEBKGND with the device context obtained using the GetDC(..) API, the flicker disappears, but during the resizing, the window redraw was "oblique" and there was no problem with the edges of the main window resolved.
However, this is much better than the source code.
Question:
How to get rid of the problems demonstrated in my demo application above?
I hereby thank everyone who invests their time and efforts to try to help me.
Sincerely.