Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 15:49, 17 June 2008.

How to check whether the application is running

From Forum Nokia Wiki

Header File

#include <apacmdln.h>  
#include <apgcli.h>    
#include <apgtask.h>
#include <e32std.h>
#include <w32std.h>     
 
class MySystemUtils
{
    
     /**
		   *  Description : Function to check
                                    whether the applicaton is running.   
		   *  Params      : UID of the application to be checked
		   *  Returns     : true if the application is running
		   */
		   static TBool IsApplicationRunningL( const TUid& aApplicationUid );
 
		   /**
		   *  Description : Function to check if the executable is 
                                    running or not
		   *  Params      : Descriptor containing name of Exe
		   *  Returns     : true if running 
		   *  Comments    : format exename*
                   */
		   static TBool IsExeRunning( const TDesC& aExeName );
 
 
};


Checking whether the Application is Running

TBool MySystemUtils::IsApplicationRunningL( const TUid& aApplicationUid )
{ 
   RWsSession windowSession;
   User::LeaveIfError( windowSession.Connect() );
 
   TApaTaskList apataskList( windowSession);
   TApaTask apatask = apataskList.FindApp( aApplicationUid );
 
   TBool situationFlag = apatask.Exists();
 
   // Close window server session
   windowSession.Close();
 
   return situationFlag;
}


Checking Whether the Exe is Running

TBool MySystemUtils::IsExeRunning( const TDesC& aExeName )
{
   TFileName executableName;
   executableName.Copy( aExeName );
   executableName.Trim();
   executableName.Append(_L("*")); 
   
   TBool situationFlag = EFalse; 
   TFindProcess processSearch;
   TFullName processFullName;
   while( processSearch.Next( processFullName ) == KErrNone) 
   {
      
      if( processFullName.Match(executableName) != KErrNotFound ) 
      { 
         return ETrue;
      }
   }
   return situationFlag;
}
Related Discussions
Thread Thread Starter Forum Replies Last Post
手机上 电话本中的"Internet telephone"对应的TUid定义是什么? S_MariO Symbian 6 2008-02-02 07:16
Killing an Exe during boot time santosh shetty General Symbian C++ 2 2006-06-13 05:48
AKNSKINS.dll error everyourgokul General Symbian C++ 1 2007-08-04 06:04
How to send sms to application running on my notebook zjw007 PC Suite API and PC Connectivity SDK 2 2003-08-01 00:38
Keeping a Java App active kbrooking Mobile Java General 2 2006-03-21 14:26
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX