You Are Here:

Community: Wiki

This page was last modified on 3 January 2008, at 05:03.

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 Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia