比如程序在D:\QQ.exe谢谢了!!!
1 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
int main()
{
TCHAR szExe[] = _T("D:\\QQ.exe");
TCHAR szCmd[16] = {0};
STARTUPINFO si;
PROCESS_INFORMATION pi;
si.cb = sizeof(STARTUPINFO);
GetStartupInfo(&si);
if(!CreateProcess(szExe, szCmd,
NULL, // process info
NULL, // thread info
TRUE, // inheritable
0, // creation flags
NULL, // environment
NULL, // current directory
&si, & pi))
{
printf(_T("open process: %s failed with error: %d\n"), szExe, GetLastError());
}
else
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
- 1 回答
- 0 关注
- 413 浏览
添加回答
举报
0/150
提交
取消