To block user interface events from being generated, you must discard the corresponding events in the controls callbacks.
In your application, you can use a global variable as a flag for "updating in process" and in controls' callbacks swallow the user interface events, this way:
if (operationInProgress) {
switch (event) {
case EVENT_LEFT_CLICK:
case EVENT_RIGHT_CLICK:
case EVENT_LEFT_DOUBLE_CLICK:
case EVENT_RIGHT_DOUBLE_CLICK:
case EVENT_KEYPRESS:
return 1; // Swallow the events
default:
return 0;
}
}