STARTUPINFO si;
    PROCESS_INFORMATION pi;

    memset(&si, 0, sizeof(si));
    si.cb = sizeof(STARTUPINFO);
    //路径不能写死

    CString str;
    str.Format(_T("Test.exe"));
    LPWSTR   pointer;
    pointer = (LPWSTR)(LPCTSTR)str;
    if (CreateProcess(NULL, pointer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
    {
        //m_dwProcessId = pi.dwProcessId;
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);
    }

 

posted on 2017-07-22 17:25  瓦楞球  阅读(181)  评论(0编辑  收藏  举报