title: How to Prevent ProcessMessages in Delphi
body: <p>The Application.ProcessMessages command is well known and I use it in long processes to ensure my program will not tie up the computer.</p>
  
  <p>But I have one fairly quick set of processing, where I am buffering a view into a file. During the buffering procedure, a few system messages may get sent off (e.g. redraw or scrollbar move or other events). I want to prevent these from getting handled by ProcessMessages until my buffering is complete.</p>
  
  <p>Is there any way to either:</p>
  
  <ol>
  <li><p>Prevent Application.ProcessMessages until my procedure is complete, or</p></li>
  <li><p>Trap all messages generated during my procedure, and not release them until the end of the procedure.</p></li>
  </ol>