Uhm, not quite. You got one part almost right - in your main event loop, you should call EvtGetEvent with a variable for the timeout parameter, instead of the usual evtWaitForever constant (which is not zero, BTW - it is -1). This variable should be either global or pseudo-global (i.e., dynamically allocated, its memory protected, and a pointer to it passed via a feature or in some other similar way).
Then, in the event handler of the form that has to perform your lengthy task (I have no idea whether it is your main form), you do the following: 1) On frmOpenEvent, you set the global timeout variable to something reasonably small - e.g., 1, or SysTicksPerSecond()/10 or whatever you consider "reasonably often". This will ensure that the main event loop will get nilEvents at least that often. 2) On nilEvent, you perform the next small part of the work and set some variable that tells you how far you are in the completion of the task - so that on the next nilEvent you know to peform the next part of it. 3) On frmCloseEvent, you set the global timeout variable back to evtWaitForever (it should be initialized with this value when your program starts, too) - so that you don't drain the batteries unnecessarily. This strategy ensures that your main event loop gets nilEvents often enough. Each time it gets a non-system and non-menu event, it calls the event handler of the currently active form. (At least I hope so; this is the standard design of the main event loop in PalmOS applications.) So, when your form that has to perform the lengthy task is active, its event handler will receive control on every nilEvent. I then just needs to do the next small part of the work. Regards, Vesselin -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
