Your Paint event will fire. This does not mean that all windows will be completely painted, but you can sleep less. Listening to the notification message by overriding WndProc () may work, but not necessarily, when it is sent. WM_DWMCOMPOSITIONCHANGED is a 0x31e message. I suspect that it will be sent too soon, all windows may have to be repainted further. The only way to make sure is to list the windows with EnumWindows and call UpdateWindow. Visit pinvoke.net for the P / Invoke ads you need. Sleep () will also work, but there is no way to guess the amount guaranteeing that it will work everywhere.
source
share