IWinApplication.ProcessMessages

Syntax

ProcessMessages;

Description

The ProcessMessages method sends a request to process system messages causing rerendering of application window.

Comments

Method calling results in checking a queue of system messages addressed to a current application window. If the queue contains some objects, the messages, which update the window contents, are immediately processed. After processing the messages are deleted from the queue.

The method use is relevant when long-term processes are executed to refresh application windows' contents.

Example

Sub DoProcess;
Var
    b: Boolean = False;
    WinApp: IWinApplication;
Begin
    //...
    WinApp := WinApplication.Instance;
    Repeat
        //...
        //Cyclic actions
        //...
        If <Cycle exit condition> Then
            b := True
        End If;
        WinApp.ProcessMessages;
    Until b;
End Sub DoProcess;

The specified procedure can be used to start any cyclic processes, the runtime of which is unknown. The ProcessMessages method is called at the end of each iteration to refresh window contents.

See also:

IWinApplication