I know how to print the active application using SetForegroundWindow.
The problem is when I use :
SetForegroundWindow(hwnd); // focus the window I want
PrintActiveApp(); // print this window (no problem)
The problem is when the window is hidden behind another one, there is kind of delay before the window is repainted (so a part of the top window is drawn on the picture).
I only want to be sure the focused window is the one I want and this window is drawn properly to print it.
Thanks in advance for your help.