language agnostic - Reliable way to wait for another Windows process to redraw its main window -


I'm running a window (related to another process) on the front to take a screenshot. I'm able to use it in SetForegroundWindow , even though that function comes back immediately. I take the second process in a different amount of time to redraw the main window (for which it is up to the database Need to reach), so I can not make sure that when I take a screenshot, the window is sung completely. Sometimes whatever I find in the screenshot, it's the goal window's layout, which was in the foreground of any window before.

Is there a reliable way to wait until another process window is fully featured? I suspect that this is not so, but it's worth a shot. Maybe there is a message that I can send to the window that will be with this effect?

Note : The language of implementation is not important, but I need to solve the problem using the native Windows API, either directly from the C / C ++ code or P / Unwatch (via C # or VB.Net) Unfortunately I can not use any WinForms functions.

The window will need to be redone again if its any part of it is returned again and again.


Comments