×
Namespaces

Variants
Actions
Revision as of 13:56, 25 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to run the file with the default application

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: kavitaobhan (20 Nov 2007)
Last edited: hamishwillee (25 Jul 2012)

Headers

#include <apacmdln.h>  
#include <apgcli.h>
#include <apgtask.h>
#include <w32std.h>


Running a File with the default application

// Starts the default application for the passed file and runs the file in it.
/*
*@param aFileLocation :- File to be Launched by corresponding default application.
*/

 
 
void MySystemClass::LaunchDefaultApp( const TDesC& aFileLocation )
{
RApaLsSession applicationSession;
TUid Uid;
TDataType currentdataType;
RFs file;
RWsSession windowSession;
TThreadId currentthreadId;
 
file.Connect();
applicationSession.Connect();
applicationSession.GetAllApps();
applicationSession.AppForDocument(aFileLocation ,Uid,currentdataType);
windowSession.Connect();
 
TApaTaskList apataskList(windowSession);
TApaTask apatask = apataskList.FindApp( Uid );
 
applicationSession.StartDocument(aFileLocation ,Uid,currentthreadId);
applicationSession.Close();
file.Close();
windowSession.Close();
 
 
}

Related Links

Launching default application based on MIME type

This page was last modified on 25 July 2012, at 13:56.
49 page views in the last 30 days.
×