⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exelauncher_appui.cpp

📁 《SymbianOSC手机应用开发》源码
💻 CPP
字号:
// ExeLauncher_AppUi.cpp
//
// Copyright (c) 2002 Symbian Ltd.  All rights reserved.
//

#include "ExeLauncher_AppUi.h"
#include "ExeLauncher_Document.h"

#include <f32file.h>


void CExeLauncherAppUi::ConstructL()
  {
  CEikAppUi::ConstructL();


  iAppView = CExeLauncherAppView::NewL(ClientRect());
//  iProcess = new(ELeave) RProcess;
  
  iDirFspec    = iEikonEnv->AllocReadResourceL(R_EXELAUNCHER_DIR_FSPEC);
  RFs& fs = iCoeEnv->FsSession();
  CDir *DirList = NULL;
  fs.GetDir(*iDirFspec,KEntryAttNormal,ESortNone,iFileList,DirList);
  delete DirList;
  iAppView->AppendItemsAndActivateL(iFileList);
  }
  
CExeLauncherAppUi::~CExeLauncherAppUi()
  {
  delete iAppView;
  delete iDirFspec;
  delete iFileList;
  }

void CExeLauncherAppUi::HandleCommandL(TInt aCommand)
  {
  switch (aCommand)
    {

    case EEikCmdExit: 
		// Exit the application. The call is
		// implemented by the UI framework.
      Exit();
      break;
    case EExeLauncherCmdLaunch:
    	// Run the selected .exe file 
      TInt i = iAppView->GetCurrentItem();
      if (iFileList && (i<iFileList->Count()))
      	{
      	TPtrC name = (*iFileList)[i].iName;
  	  	RFs& fs = iCoeEnv->FsSession();
      	TParse fp;
      	fs.Parse(name, *iDirFspec,fp);
      	const TDesC& runExeDesC = fp.FullName();
      	TInt retval = iProcess.Create(runExeDesC, runExeDesC);
      	if (retval == KErrNone)
        	{
        	iProcess.Resume();
        	iProcess.Close();
        	break;
        	}
        }
      iEikonEnv->InfoMsg(R_EXELAUNCHER_TEXT_RUNFAILED);
      break;
    }
  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -