How to hide your application from running tasks list, and how to hide the round circle over your running application icon
This article explains how to hide your application from running tasks list - Task Switcher - and how to hide the round circle over your application icon when it is running in the background.
Sometimes you want to keep your application running hidden in the background from running tasks list - Task Switcher / Show Open Applications - to avoid accidentally shutting it down by user.
1- How to send your application to background.
iEikonEnv->RootWin().SetOrdinalPosition(-1); // Change (-1) to (0) to get your application to foreground
2- How to hide your application from running tasks list.
This step needs you to implement a virtual function at your project 'Document' object, which is UpdateTaskNameL()
// implement the following virtual function in your project Document Object (YourProjectDocument.h)
#include <apgwgnam.h> // For CApaWindowGroupName
void UpdateTaskNameL( CApaWindowGroupName* aWgName );
// implement the following virtual function in your project Document Object (YourProjectDocument.cpp)
void CYourApplicationDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName )
aWgName->SetHidden(ETrue); // This function hides your application from running tasks list
aWgName->SetSystem(ETrue); // This functions sets your application as System application
3- How to hide the round circle over your running application icon.
// Add the following function under your AppUi object ConstructL() function:
Using The code snippets mentioned above in your project makes sure that your application is running hidden from 'Running Tasks List' to avoid accidentally shutting it down. And gives it a professional look, as most users are annoyed by the round circle over the running applications icons.