This page was last modified 05:03, 3 January 2008.
How to retrieve a list of currently running tasks?
From Forum Nokia Wiki
A list of currently running tasks can be retrieved with TApaTaskList class. A task is identified by its association with the running application's window group. A session to the window server needs to be passed to TApaTaskList during construction.
#include <apgtask.h> // link against apgrfx.lib TApaTaskList tasklist(CCoeEnv::Static()->WsSession()); TApaTask taskInForeground = tasklist.FindByPos( 0 ); // Window Group ID of the foreground task TInt WindowGroupIdentifier = taskInForeground.WgId(); // Thread ID of the foreground task TThreadId ThreadIdentifier = taskInForeground.ThreadId();
The first task in TApaTaskList is the one in foreground (the associated window group has ordinal position 0).
TApaTask contains some information about the task. For example, the thread identifier (ThreadId()) and window group identifier (WgId()).
Furthermore, there are useful methods such as EndTask() that requests the task to close normally, and KillTask() that directly terminates the task. SendToBackground() and BringToForeground() can be used for controlling the application's position in the task list.
Other Related Links
Tasks (running GUI application), how to find them
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| N71 slower than 6681 !!?? | chand81 | General Discussion | 6 | 2007-06-12 05:26 |
| TimerTask | mshita | Mobile Java General | 2 | 2004-06-06 10:42 |
| 问一个S80中视图切换的问题 | Lxy79 | Symbian | 3 | 2006-07-25 19:47 |
| scan mass media drives for a file | jlague | General Symbian C++ | 1 | 2007-03-27 22:27 |
| Background Console Server! | amerzannouneh | General Symbian C++ | 12 | 2008-09-08 16:33 |
