How to send message to a specified application
Article Metadata
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


20 Sep
2009
This article presents code snippest to send message to a specified application. Many times we need to interact with some another application. This example code presented here sends a specified message, which is stored in TDesC type buffer, to another application.
This article can be beneficial for beginners.