_popen: 不显示 shell 窗口 (SW_HIDE) [英] _popen: do not show the shell window (SW_HIDE)

查看:53
本文介绍了_popen: 不显示 shell 窗口 (SW_HIDE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 c++ mfc 中执行 _popen 命令时,它会打开一个我不喜欢的 shell 窗口,是否可以将其隐藏?例如,当您尝试使用 ShellExecute 函数执行命令时,它可以选择使用 SW_HIDE 隐藏 shell 窗口.

When I execute the _popen command in c++ mfc it opens a shell window which I don't like, is it possible to make it hidden? for example when you try to execute commands with ShellExecute function it has the option to hide the shell window with SW_HIDE.

推荐答案

来自 文档:

如果在 Windows 程序中使用,_popen 函数会返回一个无效的文件指针,导致程序无限期地停止响应._popen 在控制台应用程序中正常工作.要创建重定向输入和输出的 Windows 应用程序,请参阅 Creating平台 SDK 中具有重定向输入和输出的子进程.

If used in a Windows program, the _popen function returns an invalid file pointer that causes the program to stop responding indefinitely. _popen works properly in a console application. To create a Windows application that redirects input and output, see Creating a Child Process with Redirected Input and Output in the Platform SDK.

这篇关于_popen: 不显示 shell 窗口 (SW_HIDE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆