Instead of using GetUserEvent, simply install the popup and use a loop and some global variables this way:
1. Set global variables to 0
2. Create a callback for the OK, QUIT or whichever button is in your UIR that concludes the panel; in the callback raise a flag (e.g. "OKbutton = 1")
3. In the timer callback raise another flag when time expires (e.g. "timeout = 1")
4. The routine will look as follows:
// preceding instruction up to the popup display
InstallPopup (panelHandle);
while (TRUE) {
ProcessSystemEvents (); // To permit detecting user interface events
if (OKbutton) {
// Set some flag to determine following code behaviour
break;
}
if (timeout) {
// Set some flag to determine following code behaviour
break;
}
}
RemovePopup (0);
// Your code follows here
// ...
This way your code should work the same way as using GetUserEvent but with the additional timeout feature.
Hope this helps
Roberto