A control panel application is used to modify system settings. To create a control panel application a registration resource file is required which contains information about the application UID and the name of the application’s executable.
Note: You need to create the registration resource file and specify its source and destination path in the mmp file.
The following procedure describes how to prepare the registration resource file and create a control panel application:
Define the attributes of the control panel application in the registration resource file.
The attributes of the APP_REGISTRATION_INFO resource must have the KAppIsControlPanelItem attribute as shown in the code snippet:
#include <appinfo.rh> UID2 KUidAppRegistrationResourceFile UID3 0x23256ADE RESOURCE APP_REGISTRATION_INFO { app_file = app_CTRL2; attributes=KAppIsControlPanelItem; }
In the source code of the application, create an instance of the CApaSystemControlList class using the CApaSystemControlList::NewL() function to create and initialize a control panel application list as shown in the code snippet. The CApaSystemControlList class provides a list of all the available control panel applications present on the device.
// Create a file server session by creating an RFs object. RFs fs; fs.Connect(); CApaSystemControlList* cControlList; TRAP(ret,cControlList=CApaSystemControlList::NewL(fs)); if( ret==KErrNone ) { //success scenario , implementation... }
Also in the application's source code, create a control panel application in either of the following ways:
// Using UID const TInt KsimpleAppUidValue = 0x23256ADE; // Create the control panel application in the list using the specified UID CApaSystemControl* Control = cControlList->Control(TUid(KsimpleAppUidValue));
//Using Index // Create a control panel application using the index ID TInt indexID = 2; CApaSystemControl* control=cControlList->Control(indexID);
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.