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

From Nokia Developer 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 07:39.
69 page views in the last 30 days.