How to wait for a window to finish its painting in Win32?
I use the function PrintWindow to get the screenshot of a certain wi开发者_开发问答ndow.
However, due to certain reason, the call to PrintWindow usually triggered when the window is drawing itself, and thus some parts of the window which have not been drawn yet are totally black.
Any solution to wait for the window to finish its painting?
Waiting for the window to finish its painting is not the solution to the problem. Or, put another way, the problem is not that PrintWindow
is called whilst the target window is part way through its paint cycle.
PrintWindow
functions by posting a WM_PRINT
(or WM_PRINTCLIENT
) message to the target window and then waiting for the target window's message queue to process that message. Queued messages do not interleave.
In order to get to the bottom of the actual problem I think you will need to supply more details.
精彩评论