工控编程吧
标题:
上位机MFC如何调用其他程序?这里有3种方法
[打印本页]
作者:
qq263946146
时间:
2019-10-20 14:33
标题:
上位机MFC如何调用其他程序?这里有3种方法
void CDemoDlg::OnTest1()
{
//运行计算器应用程序
WinExec(_T("calc.exe"), SW_SHOW);
}
void CDemoDlg::OnTest2()
{
//运行计算器应用程序
ShellExecute(m_hWnd, _T("open"), _T("calc.exe"),
_T(""), _T(""), SW_SHOW);
}
void CDemoDlg::OnTest3()
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
//运行计算器应用程序
::CreateProcess(NULL, _T("calc.exe"), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
NULL, NULL, &StartupInfo, &ProcessInformation);
}
欢迎光临 工控编程吧 (https://www.gkbc8.com/)
Powered by Discuz! X3.4