惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
O
OpenAI News
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
Project Zero
Project Zero
Attack and Defense Labs
Attack and Defense Labs
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
L
Lohrmann on Cybersecurity
Cloudbric
Cloudbric
I
Intezer
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
AI
AI
B
Blog
S
Securelist
P
Proofpoint News Feed
量子位
Jina AI
Jina AI
V2EX - 技术
V2EX - 技术
T
The Exploit Database - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
CERT Recently Published Vulnerability Notes
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - 凌点

clr20r3 system.InvalidOperationException 程序终止的几种解决方案 能上Q 不能上网 JavaScript中url 传递参数(特殊字符) apache 多站点配置 C#中使用 SendMessage 向非顶端窗体发送组合键 System.Xml.XmlException: 根级别上的数据无效 XP,WIN7双系统启动问题 VM安装XP注意事项 make 信息重定向 VC 进度条制件CProgressCtrl 用法笔记 VC List Control控件高级使用 List Control 控件技巧总汇 VC中字符串取子串总结 如何禁用Windows屏保和电源管理 VC获取硬盘物理序列号 unicode cstring to char* - 凌点 将unicode的 Cstring 复制到粘贴板 VC由进程ID获取窗口句柄 嵌入式Linux操作系统学习规划
VC 命令行 捕获输出
凌点 · 2010-11-12 · via 博客园 - 凌点

代码

        STARTUPINFO   si;   //   启动信息   
    PROCESS_INFORMATION   pi;   //   进程信息   
    si.cb   =   sizeof(STARTUPINFO);   
    GetStartupInfo(
&si);   //取得当前进程的StartupInfo,并根据当前进程进行修改 
    si.hStdError   =   hWrite;   //错误输出 
    si.hStdOutput   =   hWrite;   //标准输出 
    si.wShowWindow   =   SW_HIDE; 
    si.dwFlags   
=   STARTF_USESHOWWINDOW   |   STARTF_USESTDHANDLES; 
    CString strCmdLine 
="cmd" ;
    
//创建子进程 
    if   (!CreateProcess(NULL, strCmdLine.GetBuffer(),NULL,NULL,TRUE,NULL,NULL,NULL,&si,&pi)) 
    { 
        MessageBox( 
"创建进程失败!"); 
        
return
    } 
    CloseHandle(hWrite); 
    Sleep(
200); 
    
char   buffer[4096]   =   {0};   
    DWORD   bytesRead;   
    
while   (true
    {   
        
if   (ReadFile(hRead,buffer,4095,&bytesRead,NULL)   ==   NULL)   
            
break;   
        CString strInfo;
        GetDlgItemText(IDC_EDIT_Info,strInfo);
        strInfo   
+=   buffer;  
        SetDlgItemText(IDC_EDIT_Info,strInfo);
        
//TRACE(buffer); 
    } 
    CloseHandle(hRead);