Author: Tomas Rutkauskas
Is there a way to stop an application from painting during heavy calculations?
Answer:
Call LockWindowUpdate() on your MainForm. Your form will not be redrawn and cannot
be moved until you unlock it by passing 0 as the window handle.
Note that LockWindowUpdate() does not hide the form nor does it reset the
WS_VISIBLE style bit.
1 2 LockWindowUpdate(MainForm.Handle); // pass the handle of window to lock3 4 // heavy calculation here5 6 LockWindowUpdate(0); // unlock it