work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C++ 打开exe文件的方法(VS2008)

Posted on 2011-11-19 21:48  work hard work smart  阅读(4567)  评论(0编辑  收藏  举报

C++ 打开exe文件的方法(VS2008)

#include "stdafx.h"
#include <Windows.h>
#include <ShellAPI.h>

int _tmain(int argc, _TCHAR* argv[])
{
	SHELLEXECUTEINFO shell = { sizeof(shell) };
	shell.fMask = SEE_MASK_FLAG_DDEWAIT;
	shell.lpVerb = L"open";
	shell.lpFile = L"C:\\windows\\NOTEPAD.EXE";
	shell.nShow = SW_SHOWNORMAL;
	BOOL ret = ShellExecuteEx(&shell);
	return 0;
}