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.

Changing the owning window group of a Symbian C++ application

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): All (S60)
Keywords: SetOwningWindowGroup
Created: User:Technical writer 2 (July 4, 2007
Updated: May 7, 2010)
Last edited: hamishwillee (01 Aug 2012)


It is possible to select the task that will be brought to the foreground after exiting an application. By default, if the application was launched from the menu (application grid), the menu will also return to foreground when the application exits.

This can be changed by setting the owning window group for an application:

  void RWindowGroup::SetOwningWindowGroup( TInt aIdentifier );


The following piece of code demonstrates how to set the idle screen of the phone application as the owning window group, which will be brought to foreground when this application exits.

 #include <apgtask.h>    // link against apgrfx.lib, ws32.lib
const TUid KUidPhoneIdle = { 0x100058B3 }; // 0x101FD64C in S60 3rd Ed (3.0)
TApaTaskList taskList( iCoeEnv->WsSession() );
TApaTask task = taskList.FindApp( KUidPhoneIdle );
if( task.Exists() )
iCoeEnv->RootWin().SetOwningWindowGroup( task.WgId() );

Note that the UID of the phone application has changed between S60 3rd Edition and S60 3rd Edition, FP1.

This page was last modified on 1 August 2012, at 04:39.
28 page views in the last 30 days.