慕码人2483693
#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 infoNULL, // thread infoTRUE, // inheritable0, // creation flagsNULL, // environmentNULL, // current directory&si, & pi)){printf(_T("open process: %s failed with error: %d\n"), szExe, GetLastError());}else{CloseHandle(pi.hProcess);CloseHandle(pi.hThread);}}