This may be a tough one to describe, but here goes...

I have an wireless email application that can be configured to check 
ail on a regular basis. When it is time to check mail, I check if the 
device is sleeping, and if it is not, I sub launch my app to pop up a 
dialog to ask the user if they want to stop what they are doing and 
check mail. There are 3 options (check mail, skip this one, or ask again 
in 5 minutes)

This dialog pops up no matter what application is on the screen.

To do this, I call FrmPopup dialog, then i go into a "mini" event loop 
of the standard form. The only thing a little different is that I don't 
use appStopEvent to kill my event loop, I use a custom event:

static void MiniEventLoop (void)
{
   UInt32   ticks = 10;
   EventType event;

   do
      {
      EvtGetEvent (&event, ticks);
      
      //if (Recording)
      // recordEvent(&event, "*");
         
      if (! SysHandleEvent (&event))
         {
         if (! MenuHandleEvent (NULL, &event, &error))
            {
            //is this for our dialog?
            if (! MiniApplicationHandleEvent (&event))
               {
               FrmDispatchEvent (&event); 
               }
            }
         }
      }     
   while (event.eType != miniEventLoopStopEvent);
}

where miniEventLoopStopEvent is defined as:
#define miniEventLoopStopEvent firstUserEvent


This works great...I display the dialog, the user presses one of the 
buttons, I take the appropriate action, then I just want to dismiss the 
dialog. to do this, call FrmReturnToForm(0), and I post a 
miniEventLoopStopEvent into the event queue.

My form closes, the event loop ends, I am done. 

The problem is this, the application that is running under me gets my 
miniEventLoopStopEvent event to process after I leave. ??? This should 
not happen as I only post one of these events, I get the event, and the 
app below me should not get this event. 

The problem I with this happening is that some apps don't like to get 
this event, as they use it for something else, and one in particular 
crashes when it gets my version of the event. 

I can fix this crash by changing my event to some other define higher in 
the event order, but I don't know what other apps will care about the 
one I change it to. The may not fix the problem.

Does anyone know what is going on here, and how I can prevent this event 
from getting the the app below me?

thanks for hanging in to the end of this one.

Michael Golden

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to