INTRODUCTION AND RELATED INFORMATION:
I am trying to draw an image in my main window in full size. Currently I need to display EMF.
After browsing over the internet, I found this MSDN example .
Problem:
I tried and found out that this does not work.
After right-clicking, as the instructions say, a screenshot of the desktop is correctly displayed in the main window.
However , when the user resizes the window, they draw artifacts similar to those shown below. The effect below also occurs when the user scrolls a bit and then resizes the window.
Here is the image:

This is my first time trying to scroll an image and use scrollbars, so itβs really hard for me to find a solution.
QUESTIONS:
How to fix article code to remove this visual artifact?
Can you recommend another example, for example, a tutorial / sample code / etc, which I can learn?
Can you provide βverbalβ instructions / recommendations that can help me?
To make your task even easier, here is the smallest code that reproduces the problem. Note that I just copied / pasted the window procedure and added the minimal code for the program to create a working demo:
source share