如何等待窗口在Win32中完成绘画? [英] How to wait for a window to finish its painting in Win32?
问题描述
我使用函数PrintWindow获取某个窗口的屏幕截图。
I use the function PrintWindow to get the screenshot of a certain window.
然而,由于某些原因,PrintWindow的调用通常在窗口绘制时触发,因此窗口中尚未绘制的部分是完全的
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?
推荐答案
等待窗口完成它的绘画不是解决问题的办法。或者,换句话说,问题不是 PrintWindow
被调用,而目标窗口是其绘画周期的一部分。
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
c>)消息到目标窗口,然后等待目标窗口的消息队列来处理该消息。排队的邮件不交叉。
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.
这篇关于如何等待窗口在Win32中完成绘画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!