tmainfrm3.cpp

来自「mpq文件的格式就是一种压缩格式」· C++ 代码 · 共 53 行

CPP
53
字号
/*****************************************************************************/
/* TMainFrm2.cpp                          Copyright (c) Ladislav Zezula 2003 */
/*---------------------------------------------------------------------------*/
/* Implementation of running MoPaq 2000 scripts                              */
/*---------------------------------------------------------------------------*/
/*   Date    Ver   Who  Comment                                              */
/* --------  ----  ---  -------                                              */
/* 18.04.03  1.00  Lad  The first version of TMainFrm2.cpp                   */
/*****************************************************************************/

#include "stdafx.h"
#include <conio.h>
#include "TMainFrm.h"
#include "TTreeView.h"
#include "TListView.h"
#include "TConsole.h"

//-----------------------------------------------------------------------------
// Script running

int TMainFrame::WTRunMPQ2000Script(char * szScript)
{
    TConsole * pConsole = NULL;
    RECT rect;
    int nError = ERROR_SUCCESS;

    // Create new console
    if(nError == ERROR_SUCCESS)
    {
        m_pListView->GetWindowRect(&rect);
        pConsole = new TConsole();
        nError = pConsole->CreateConsoleWindow(m_hWnd, rect);
    }

    // Set the working directory for the script or console
    SetCurrentDirectory(cfg.szWorkPath);

    if(nError == ERROR_SUCCESS)
    {
        m_hConsole = pConsole->GetWindow();

        if(szScript == NULL || *szScript == 0)
            pConsole->RunConsoleMode();
        else
        {
            // Perform the "script" command
            sprintf(pConsole->m_szCommand, "script \"%s\"", szScript);
            pConsole->RunCurrentCommand();
        }
    }
    return nError;
}

⌨️ 快捷键说明

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