Thank you Richard and Danny.

  Sorry for the delayed response. 

Richard M. Hartman wrote:
 > It might be easier to try to hook into the app switching API
 > and just keep a record of which app is being launched (like
 > what switchhack does).  Then when your app needs to know
 > what's running, it just checks the records.

  Thanks! I've done it in 2 way.

1. Hook SysAppLaunch and keep the App DB ID
2. Look into System Global nextUIAppCardNo or nextUIAppID

Though both is not documented method and not warrantied to work in the future OS. So I 
want to do it in documented way.

Danny @ Palm wrote:
 >> I'm writing a Notifiction Handler and want to know what is current
 >> user-interface application. ( SysCurAppDatabase won't work because
 >> it returns database which include Notification handler)
 >
 >Perhaps this is stating the obvious, but during a SysAppLaunch of your app,
 >you can tell whether your app is the current UI app by checking the
 >sysAppLaunchFlagSubCall flag.
 >If you want to know whether some other app is the current UI app, and you
 >can modify that app, you can create a feature in that app's AppStart
 >function and remove it in it's AppStop function. Then the existence of this
 >feature indicates that the app is the current UI app.

 Thanks . But my software ( DA Launcher) is working as background so this won't 
work.

 >I don't know of any way to generically determine the current UI app using
 >public APIs.
 >
 >Can you explain what you're trying to do? This isn't the first time this
 >issue has come up, so I'm wondering what's driving the need for this
 >feature.

  For example, I'm creating a Notification Handler for Memory Card Insertion/Removal.

  When user insert Memory Card, My notification handler( valid not only when my app is 
running but always)  check for the memory card and copy some of them into internal 
memory if necessary,

  After that,  I want to switch to Launcher. I can do it by enqueing Launcher virtual 
key code. But when It's already in Launcher, don't want to enque launcher key( It 
switches category). So I want to know if Launcher is current UI application.
  PalmOS4.0 have this "Switching to Launcher" feature built-in but I want to make it 
compatible with CLIE (OS3.5 ) or HandEra330. So I can't rely on PalmOS4.0's built-in 
feature.

  2nd, I'm modifying my DA Launcher from Hack to normal Application . and want to 
provide DA software what is current UI application. Some DAs use it for.

  1. Relaunch current application to activate changed preferences ( Show/Hide secret, 
Volume and so on)

  2.  To know the current database and record.( I don't know exactly but Bookmark DA 
looks like doing this)

  Also there's many chances that Notification handler or Hack change it's behavior 
depends on what is current UI application. 

regards


  

YAMADA Tatsushi Hacker Dude-san
http://simple-palm.com
mailto:[EMAIL PROTECTED]



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

Reply via email to