标签:方法 ror win office process sof 函数 start stream
1. C++中创建进程的代码示例:
// ProcessDemo.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include<windows.h> #include <iostream> using namespace std; int main() { STARTUPINFO startupInfo = { 0 }; PROCESS_INFORMATION processInformation = { 0 }; /*打开Word应用程序 C:\\Program Files (x86)\\Microsoft Office\\Office14\\WINWORD.EXE 为程序路径*/ BOOL bSuccess = CreateProcess(TEXT("C:\\Program Files (x86)\\Microsoft Office\\Office14\\WINWORD.EXE"), NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &startupInfo, &processInformation); if (bSuccess) { cout << "Process started..." << endl << "ProcessID: " << processInformation.dwProcessId << endl; } else { cout << "Can not start process!" << endl << "Error code: " << GetLastError(); } system("pause"); }
标签:方法 ror win office process sof 函数 start stream
原文地址:https://www.cnblogs.com/runningRain/p/12939605.html