I have not found a way to trap all user events when a process is running.
Essentially my program executes in a simple loop:
//intialize panels, variables, etc.
program_running=1;
while(program_running)
{
ProcessSystemEvents();
//read data from comport
//process data
}
//end program
All control events are processed in callbacks.
I have several processes during which the user is supposed to wait. I put up a message panel and inhibit events:
InstallPopup(messagePanel)
SetSystemAttribute (ATTR_SUPPRESS_EVENT_PROCESSING, YES);
//process code executes here, user is suppoes to wait
SetSystemAttribute (ATTR_SUPPRESS_EVENT_PROCESSING, NO);
RemovePopup
(0);
At this point if the user has pressed the mouse when he is not supposed to, and if there is a control where he pressed the mouse, the callback is processed. So I tried this loop to catch the unwanted events:
event=1;
while(event)
event=GetUserEvent(0,&panel,&control);
It catches the first event, but then executes the callback.
Is there any way to prevent these unwanted callbacks from executing?