Hello. It has long been suffering with the removal of a screenshot from the screen (or from the application window).
I tried through .NET Graphics, as well as through Win api. Recently I started learning Java and decided to try using the built-in Java class Robot.
The result is the same everywhere - there is a screenshot, but it is not updated.
When you try to take a screenshot using Win api, the same screenshot is taken during the program operation.
When working with .NET [Graphics] and Java [Robot], the same screenshot is also taken, but it is updated when switching between windows. If the window is not switched, the screenshot will always be the same (as on the first attempt).
Can someone explain what the problem is and how to take screenshots normally, so that they are always different (what is happening on the screen or application now, and not what happened when you first took the screenshot).