He is doing it runtime, go to his first post you can see he is inserting the ListBox into the main window, that code will be in the WM_CREATE of a window or WM_INITDIALOG of a dialog.
I assumed in his rather crazy round about way what he was asking is to paint the ListBox to a memory DC rather than the screen DC.
He seems to be calling HDC "buffers" see his names ===> HDC_of_FRONT_BUFFER
Anyhow that is easy you just use the WM_PRINTCLIENT message which you subclass onto a class and handle it. WM_PRINTCLIENT message (Winuser.h) - Win32 apps | Microsoft Docs[^]
You use that mainly for printing a screen capturing of a window or remote terminal programs where you need to send the screen data.
So I gave him an example that does that, but he either doesn't understand or he is doing something really strange.
I`m trying to build a barebones MFC app. I`m used to C# Forms, but I`m having a tough time in MFC though.
I`m creating a new MFC app in the New Project dialog and in the Wizard I pick Dialog based app as app type. However after creation I can`t open the resource (in the resource view) to fill it with controls.
it`s a totally fresh project, no edits after pressing the `Finish` button in the create app wizard/dialog. I`m expecting to be able to add new controls from ToolBox but obviously something is missing...
I do not think MFC apps make use of the Toolbox. If you double-click the resource file (projectname.rc) in Solution Explorer, it should open the Resource Editor where you can add the various controls to your dialog.
The recommended MFC way is to create a control member variable (of the type CStatic or any derived from CStatic class) for this picture control. Then you will be able use all the methods of this class.