Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Getting notifications of focus change and launch of other apps using Symbian C++

From Wiki
Jump to: navigation, search
Article Metadata
Platform(s): S60 3rd Edition
Created: User:Technical writer 1 (26 Sep 2007)
Last edited: ashraf fawzy (25 Jul 2012)


Sometimes applications need to get notifications about the change of the application in focus or launching of another application.


The notifications can be enabled using the following code:

In the constructL of the AppUi, add the following lines:

//To get notifications about Focus change events
//To get notifications about launching of other applications

After these functions are called, the events are delivered to the window server every time the particular event occurs. The code to handle the notifications is as follows:

  void CMyAppUi::HandleWsEventL( const TWsEvent& aEvent,  
CCoeControl* aDestination )
if(aEvent.Type() == EEventFocusGroupChanged)
//Focus change event
//Handling to be done here
else if(aEvent.Type() == EEventWindowGroupsChanged)
//Group change event (launching of other applications)
//Handling to be done here
This page was last modified on 25 July 2012, at 13:52.
30 page views in the last 30 days.