3rd下面,如何调用系统的浏览器直接打开指定的网页??
谢谢
[解决办法]
TInt YourClass::OpenUrlL(const TDesC& aUrl)
{
if(aUrl.Length() <= 0)
return KErrGeneral;
HBufC* param = HBufC::NewLC( 256 );
param-> Des().Format( _L( "4 %S " ),&aUrl );
// Wap Browser 's constants UId
const TInt KWmlBrowserUid = 0x10008D39;
TUid id( TUid::Uid( KWmlBrowserUid ) );
TApaTaskList taskList( CEikonEnv::Static()-> WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
{
HBufC8* param8 = HBufC8::NewLC( param-> Length() );
param8-> Des().Append( *param );
task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
CleanupStack::PopAndDestroy(); // param8
}
else
{
RApaLsSession appArcSession;
User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server
TThreadId id;
appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id );
appArcSession.Close();
}
CleanupStack::PopAndDestroy(); // param
return KErrNone;
}