ProcessSystemEvents
- Updated2023-02-21
- 2 minute(s) read
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.
![]() |
Notes
|
Example Code
The following example code demonstrates how to use this function in a while loop to ensure that LabWindows/CVI processes system events while you run a continuous task. In order to do this, it is important that you break up long, continuous tasks into smaller, discrete steps.
.
.
.
while (!done)
{
ProcessSystemEvents ();
RunAdditionalStep ();
}
.
.
.
Parameters
None.
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
Example
Refer to userint\DigGraphDAQmx.cws for an example of using the ProcessSystemEvents function.