×
Namespaces

Variants
Actions
Revision as of 06:25, 6 February 2012 by hamishwillee (Talk | contribs)

How to send message to a specified application

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

Header

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


Sending Custom message to a specified application

/*
* @param aApplicationUid :- Uid of the application to which the message needs to be send
* @param aExternalMessage:- A Message to be sent to the application
*/

// Sends message to the specified application
TInt SendingMessageToAppL( const TUid& aApplicationUid, const TDesC8& aExternalMessage )
{
RWsSession windowSession;
User::LeaveIfError( windowSession.Connect() );
 
TApaTaskList apataskList( windowSession);
TApaTask apatask = taskList.FindApp( aApplicationUid );
 
const TUid KOpenCreateUid = { KUidApaMessageSwitchCreateFileValue };
TInt pseudoCode = apatask.SendMessage( KOpenCreateUid ,aExternalMessage );
windowSession.Close();
 
return pseudoCode;
}

Related Links

How to send particular Event to External application in Symbian

42 page views in the last 30 days.