Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:

TSS000649 - Retrieving a list of currently running tasks

From Forum Nokia Wiki



ID TSS000649 Creation date May 10, 2007
Platform S60 1st Edition
S60 2nd Edition and FP1, FP2, FP3
S60 3rd Edition and FP1
Series 80 2nd Edition
Devices
Category Symbian C++ Subcategory Base & System, Application Framework


Keywords (APIs, classes, methods, functions):

Overview

Retrieving a list of currently running tasks

Description

Application framework in Symbian OS provides APIs for retrieving information about the tasks that are currently running either in foreground or background.

Solution

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.

Related Discussions

Thread Thread Starter Forum Replies Last Post
Background Console Server! amerzannouneh General Symbian C++ 12 2008-09-08 17:33
Getting cell info (area name) in 3rd edition? kanu123 General Symbian C++ 7 2007-05-02 15:38
问一个S80中视图切换的问题 Lxy79 Symbian 3 2006-07-25 20:47
S60 Speed wernerkriel Series 40 & S60 Platform Feedback 11 2007-11-11 23:02
TimerTask mshita Mobile Java General 2 2004-06-06 11:42

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia