使用管道實現讀取DOS命令結果,界面如下:
主要代碼如下:
ZeroMemory(&sa, sa.nLength = sa.bInheritHandle = sa.lpSecurityDescriptor = (!CreatePipe(&hRead, &hWrite, &sa, AfxMessageBox(_T( ZeroMemory(&si, si.cb = GetStartupInfo(& si.hStdError = si.hStdOutput = si.wShowWindow = si.dwFlags = STARTF_USESHOWWINDOW | strCommand.Format(_T( BOOL res = CreateProcess(NULL, strCommand.GetBuffer(), NULL, NULL, TRUE, NULL, NULL, NULL, &si, & (! AfxMessageBox(_T( TCHAR szBuff[] = { DWORD dwRead = m_strResult = _T( ( (!ReadFile(hRead, szBuff, , & szBuff[dwRead] = _T( strTemp.Format(_T( m_strResult += UpdateData(FALSE);
下載地址:http://pan.baidu.com/s/1gdIEoJT