| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 673 人关注过本帖
标题:startupinfo结构的一个问题
只看楼主 加入收藏
emoly
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2013-6-10
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:1 
startupinfo结构的一个问题
我想知道对startupinfo结构的hStdInput hStdOutput hStdError 赋值为socket的句柄,创建的匿名管道为cmd。那三个结构参数是怎么知道传递进来的句柄是套接字并且还能把数据传输到另一端?
搜索更多相关主题的帖子: 管道 
2013-07-06 00:08
yuccn
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:何方
等 级:版主
威 望:167
帖 子:6815
专家分:42393
注 册:2010-12-16
收藏
得分:20 
底层对于管道或者socket 的操作是一样的把,可以参考msdn
http://msdn.(v=vs.85).aspx

hStdInput
If dwFlags specifies STARTF_USESTDHANDLES, this member is the standard input handle for the process. If STARTF_USESTDHANDLES is not specified, the default for standard input is the keyboard buffer.
 
If dwFlags specifies STARTF_USEHOTKEY, this member specifies a hotkey value that is sent as the wParam parameter of a WM_SETHOTKEY message to the first eligible top-level window created by the application that owns the process. If the window is created with the WS_POPUP window style, it is not eligible unless the WS_EX_APPWINDOW extended window style is also set. For more information, see CreateWindowEx.

Otherwise, this member is ignored.
 hStdOutput
If dwFlags specifies STARTF_USESTDHANDLES, this member is the standard output handle for the process. Otherwise, this member is ignored and the default for standard output is the console window's buffer.
 
If a process is launched from the taskbar or jump list, the system sets hStdOutput to a handle to the monitor that contains the taskbar or jump list used to launch the process. For more information, see Remarks.

Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2008, Windows XP, and Windows Server 2003:  This behavior was introduced in Windows 8 and Windows Server 2012.
 hStdError
If dwFlags specifies STARTF_USESTDHANDLES, this member is the standard error handle for the process. Otherwise, this member is ignored and the default for standard error is the console window's buffer.

我行我乐
公众号:逻辑客栈
我的博客:
https://blog.yuccn. net
2013-07-06 10:36
快速回复:startupinfo结构的一个问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025145 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved