Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Hairu

Gui for console applications

This topic is 5689 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to make a gui for traceroute and whois in windows. These are console applications so I somehow need to read the output from them with my GUI program. The problem is, _popen() doesn''t work in non-console windows applications. I''ve tried using CreateProcess, and CreatePipe, but the still made a dos box appear ( which i cant allow ), and besides that, they still didn''t work properly for my purposes. Any ideas? Or does anyone know where I can get the source to a small program that''s a GUI to a console program?

Share this post


Link to post
Share on other sites
Advertisement
You can hide the resulting popup console window by setting the appropriate flags of the STARTINFO structure before calling CreateProcess. To obtain the output from the process, you can set up an anonymous pipe, duplicate it and assign it to the std handle members of the STARTINFO structure. Then you can read from that pipe, dumping the output string to an edit box or some other GUI control. Here is a small C program that demonstrates how to do all this: ReadPipe.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!