So, I've run into a problem while trying to take a picture of a window located in an inactive desktop using the PrintWindow API and it is starting to get on my nerves.
The problem is that with a specific window, even though PrintWindow succeeds and I get the image of the window I want, that image is always an outdated copy of the last time the desktop was active. At first I thought the window was not receiving any input, but after some checking I noticed that it still receives and processes input, but does not render any changes until its desktop gets activated again. I tested in Windows 7 and 10, and that only happens in Windows 10.
After some more checking, I found out that the main window in fact updates itself just as expected and it is its child, which covers all the client area of the main window, who is to blame. The 2 windows were created with the following styles:
Class Styles: 0x00000003 = CS_VREDRAW | CS_HREDRAW
Parent Extended Styles: 0x00000000
Parent Standard Styles: 0x96000000 = WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS
Child Extended Styles: 0x00000020 = WS_EX_TRANSPARENT
Child Standard Styles: 0x56300000 = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_HSCROLL | WS_VSCROLL
I have already tried an absolutely uncountable amount of things trying to get this problem solved, and I've searched the web extensively, all to no avail. I am so frustrated that I am well ready to give up if noone can at least come up with an explanation for this.