I would explore the possibility of asking a window to draw itself into a bitmap, rather than trying to take a picture with a screenshot. This may be a way to make it irrelevant so that the window is minimized. Something like WM_PRINTor WM_PRINTCLIENT. I suspect that in fact what the person was trying to do, who asked the original question that you contacted. The biggest mistake is that the window does not process this message appropriately. Not all applications behave so well. In addition, I do not think that this works for windows that are really hidden, but I can’t say from your question and a flurry of articles that you refer to the question of whether it really causes concern.
, OS X; . Qt, , -, .