|
1Qter豆
#include <QCoreApplication>#include <iostream>#include <windows.h>
int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); STARTUPINFO si; memset(&si,0,sizeof(si)); si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOW;
PROCESS_INFORMATION pi;
CreateProcess(NULL,L"notepad",NULL,NULL,true, NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi); std::cout<<pi.dwProcessId; return a.exec();}
|
最佳答案
查看完整内容
代码改一下:
wchar_t szCommandLine[]=L"notepad";
CreateProcess(NULL,/*L"notepad"*/szCommandLine,NULL,NULL,true,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
|