Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 304737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:18:29+00:00 2026-05-12T07:18:29+00:00

The Application.ProcessMessages command is well known and I use it in long processes to

  • 0

The Application.ProcessMessages command is well known and I use it in long processes to ensure my program will not tie up the computer.

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.

Is there any way to either:

  1. Prevent Application.ProcessMessages until my procedure is complete, or

  2. Trap all messages generated during my procedure, and not release them until the end of the procedure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:18:30+00:00Added an answer on May 12, 2026 at 7:18 am

    Allowing the ProcessMessages to continue even if it sends messages you don’t want should not be classed as problematic. With a bit of code refactoring, you could move the buffering method into a separate thread and go from there.

    If you are attempting to copy the “visual contents” of a control into a file,

    • look at the WM_PRINT(xxx) message which allows child controls to paint themselves into bitmaps
    • try the LockWindowUpdate Win32 API method call which will turn off all painting messages to that control
    • override the WndProc/DefaultWndProc method on your control class or even the parent class if you need to and simply return “true” for each message sent
    • override specific control methods (such as “scroll bar moved”, “OnPaint“, “OnPaintBackground” etc) on the control class or even the parent and simply do nothing if your buffering is in progress

    Overriding the WndProc or DefaultWndProc and simply returning true for each message essentially “turns off” ProcessMessages but it’s not safe to do it this way because the control might need to process one or more messages to function correctly.

    Turning off ProcessMessages is not possible (without rewriting the VCL code for message processing) because of the fact that it’s part of how the VCL form’s message loop has been constructed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 180k
  • Answers 180k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It is indeed an inflammatory question. There are bindings for… May 12, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer Mono can do a few things the MS's .Net can't… May 12, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer When I remember, I like to check in after a… May 12, 2026 at 4:01 pm

Related Questions

There is a thread in my Delphi application that has a message-waiting loop. Every
I work on a large project in Delphi 5. Today, after merging two branches
I'm using Delphi 7. I'm trying to add a procedure with a call to
A certain form in our application displays a graphical view of a model. The

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.