# ProcessSystemEvents

int ProcessSystemEvents (void);

## Purpose

When your program executes in a callback function or in code that does not call RunUserInterface or GetUserEvent, LabWindows/CVI does not process user interface and system events. Functions that are overly time-consuming can "lock out" user interface and system events. To allow LabWindows/CVI to process events, call ProcessSystemEvents. Take care when using ProcessSystemEvents, because it can allow other callback functions to execute before it completes.

This function processes all pending events, including the following events:

- System events that have been delayed or suspended by a user application; for example, keystrokes, mouse events, and screen updates.
- Events generated by other applications; for example, Windows messages intended to invoke a callback installed with RegisterWinMsgCallback.

| Note LabWindows/CVI automatically updates the user interface in GetUserEvent or when a callback returns.

| Note When ProcessSystemEvents handles an event that starts a tracking loop, such as the user pulling down a menu, ProcessSystemEvents does not return until the tracking loop completes. In the case of pulling down a menu, the tracking loop does not complete until the user dismisses the menu. Consequently, do not call ProcessSystemEvents in your program if you want to continue executing the subsequent lines of code even during a tracking loop.

## Parameters

None.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success