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

📄 execute.cpp

📁 A Model-View-Controller Framework that integrates with the MFC Doc/View architecture.
💻 CPP
字号:
#include "stdafx.h"
#include "Execute.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

namespace SbjCore
{
	namespace Sys
	{
	
		bool Execute(LPCTSTR lpszExe, LPCTSTR lpszCmdLine)
		{
			bool bRslt = false;
			
			if ((lpszExe != NULL) && (_tcslen(lpszExe) > 0))
			{
				SHELLEXECUTEINFO theInfo;

				ZeroMemory(&theInfo, sizeof(theInfo));

				theInfo.cbSize = sizeof(SHELLEXECUTEINFO);
				theInfo.lpVerb = _T("Open");
				theInfo.nShow = SW_SHOW;
				theInfo.lpFile = lpszExe;
				theInfo.lpParameters = lpszCmdLine;

				if (::ShellExecuteEx(&theInfo) == FALSE)
				{
					TRACE(_T("ShellExecuteEx() failed with %ul.\n"), ::GetLastError());
				}
				else
				{
					TRACE(_T("ShellExecuteEx() succeeded.\n"));

					bRslt = true;
				}
			}
			return bRslt;
		}

	}
}

//*** Modification History ***
// $Log:  $

⌨️ 快捷键说明

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