Try something like this:
// Since this app's form is popped up, you cannot use FrmCloseAllForms to get
rid of it
// You can also not use FrmReturnToForm because the previous form is outside of
the context
// of this app. The solution is to do this all manually then, as it is shown
here.
// Keep track of the active form of the previous app
oldForm = FrmGetActiveForm();
do {
EvtGetEvent (&event, ticks);
if (! SysHandleEvent (&event)) {
if (! MenuHandleEvent (NULL, &event, &error)) {
if (! MiniApplicationHandleEvent (&event)) {
FrmDispatchEvent (&event);
}
}
}
} while (event.eType != appStopEvent);
// Delete this form
if ((syncForm = FrmGetActiveForm()) != NULL)
{
FrmEraseForm(syncForm);
FrmDeleteForm(syncForm);
// Make the previously active form the current one
if (oldForm && syncForm != oldForm)
FrmSetActiveForm(oldForm);
}
Then use FrmPopupForm to create your form.
Regards,
Peter
http://www.whizoo.com
Contractor for hire (PalmSource Certified Developer)
Source code available for all apps
Bluetooth Developer Kit for Palm OS
BtSerial Pro - Serial Port Client for Palm OS
BtSerial - Bluetooth Serial Port Client for Palm OS
BtServer - Bluetooth Serial Port Server for Palm OS
Net Sync - Programmatically manipulate network settings
RegCode - Add registration code support to your app
"Goetz Mueller" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Does anybody have an explanation for the difference of exiting a
sysAppLaunchCmdNotify launched program section?
Here's what I want to do and what I can observe:
My application with a user interface shall be launched by a
sysAppLaunchCmdNotify notification. It works perfectly if I handle the
corresponding form by FrmDoDialog with the appropriate event handler.
However, it fails (ending in a blank screen and the need to press a
hard app button and tap on the launcher button) after the application
has exited (checked with Palm Reporter) if I use a traditional
StartApplication->EventLoop->StopApplication sequence with a
EvtGetEvent loop in its core. In order to verify that this sequence
operates as it should I have called it instead of the
sysAppLaunchCmdNormalLaunch application part. Here is works perfectly,
exiting the application and falling back to the launcher or the
previously running application (yes, I know that's against the
philosophy ;-) On the other hand if I call the
sysAppLaunchCmdNormalLaunch application part in sysAppLaunchCmdNotify
notification it ends again with the blank screen. The only way to leave
the notification to the previous application or the launcher seems to
work when I avoid to use FrmGotoForm as it close the form of the
previous application before I get the frmOpenEvent.
The last idea that I now still have is to build a kind of dynamic UI to
avoid the FrmGotoForm which cause the 'resourced' form to get the
frmOpenEvent.
Any other ideas or reasons for this behaviour?
Cheers,
Goetz
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/