tags:

views:

77

answers:

1

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.

+2  A: 

Note from documentation:

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.

Nikola Smiljanić
You missed the next sentence in the doc: "_popen works properly in a console application." From the question, it sounds like _popen is working -- just not as nicely as the OP would like.
jdigital
He said "When I execute the _popen command in c++ mfc", and that sounds like windows app to me. I wouldn't use this function if I was in his place.
Nikola Smiljanić