创建进程 传递命令行参数

 

//创建进程

static const size_t url_size = 1024;
TCHAR url[url_size] = { 0 };
size_t size = _countof(url);
Update::GetInstance()->GetUpdateUrl(url, size);

TCHAR szCmdLine[2*1024] = { 0 };
_sntprintf_s(szCmdLine,_countof(szCmdLine),_countof(szCmdLine),_T(" %s"),url);
STARTUPINFO si = {sizeof(si) };
PROCESS_INFORMATION pi;
bool fSuccess = CreateProcess(_T("updatedownload.exe"),szCmdLine, NULL, NULL,
FALSE, 0, NULL, NULL, &si, &pi);

//使用lpCmdLine


int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)

你可能感兴趣的:(命令行)