This doesn't exactly answer your question, but might suggest a work around. Check the Attention Manager functions, and see if a gentle interruption might generally be warranted that can be dismissed if the user is busy, whatever app is running. /js
In your message regarding Re: determining the foreground program dated Wed, 19 Oct 2005 21:40:44 -0500, Logan Shaw said that ... > Andrew wrote: > > I apologize for not making myself more clear. How can I make my > > program know that a certain application is open (like the phone > > app on the treo) so I can reschedule the alarm for a more convenient > > time? pxaclocker gets notified and can take appropriate actions > > whenever an application is opened and changes cpu parameters. Is > > the only way to not bother a user while the phone app is open to > > watch every application that opens and take note of it and deal > > with it accordingly when the program is woken up, or is there some > > way to find out the current foreground app without doing previous > > due diligence? > > Well, this is just an idea, but it seems like it might work. > > It seems like you should be able to call DmNextOpenResDatabase() in > a loop and see if any of the ones you find is a database of type 'appl'. > Then maybe check if it has a 'code'/0 resource (and a 'tAIB'/1000 > and 'tAIN'/1000 and 'tver'/1000 resource) to ensure it really looks > like an app. If you find exactly one of those, that has to be the > app that's running, because when an app is running, its resource > database must be open. > > This won't cover all cases[1], but if your goal is only to avoid > popping up annoying stuff while a certain app is running, it might > be good enough to avoid popping it up whenever that resource database > is open, whether the app is running or not. > > - Logan > > [1] because what if you're running, say, RsrcEdit or FileZ or even > some launcher and it has another app's database open? or what > if some app intentionally leaves its resource database open so > it can have some locked code in it that can respond to > notifications? > > -- > For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > > > -- -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
