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

📄 conslauncherappui.cpp

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

#include <uikon.hrh>

#include "ConsLauncherAppUi.h"
#include "ConsLauncherAppView.h"
#include "ConsLauncher.hrh"
#include <ConsLauncher.rsg>
#include <coemain.h>
#include "ConsLauncher.pan"

void CConsLauncherAppUi::ConstructL()
    {
    BaseConstructL();

    iDirFspec    = iEikonEnv->AllocReadResourceL(R_CONSLAUNCHER_DIR_FSPEC);
    RFs& fs = iCoeEnv->FsSession();
    CDir *DirList = NULL;
    fs.GetDir(*iDirFspec,KEntryAttNormal,ESortNone,iFileList,DirList);
    delete DirList;
    iAppView = new(ELeave) CConsLauncherAppView;
    iAppView->ConstructL(ClientRect(),iFileList);
    AddToStackL(iAppView);
    }

CConsLauncherAppUi::CConsLauncherAppUi()
    {
	// No implementation required
    }

CConsLauncherAppUi::~CConsLauncherAppUi()
    {
    if (iAppView)
        {
        iEikonEnv->RemoveFromStack(iAppView);
        delete iAppView;
        iAppView = NULL;
        }
    delete iDirFspec;
    delete iFileList;
    }
    
  
void CConsLauncherAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
        {
    case EEikCmdExit:
        Exit();
        break;
    case EConsLauncherCommand1:
        {
        // 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_CONSLAUNCHER_TEXT_RUNFAILED);
        break;
        }
    default:
        Panic(EConsLauncherUi);
        break;
        }
    }

⌨️ 快捷键说明

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