Click here to Skip to main content
15,885,004 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm trying to create a program in C++, which open with him, within the form, the CMD, so that I can run a program within the CMD that is inside the program. As an example, in this photo:

http://i.stack.imgur.com/d6jes.jpg[^]

I found some examples, but could not implement them in code, so, I ask your help... To be more precise, I want to create a function in a dll, so I can call this CMD, starting from any language

examples like this: http://www.geekpedia.com/tutorial230_Capturing-Applications-in-a-Form-with-API-Calls.html[^]
But, in this sample, the code is writed in C#, and, i want C++/C, and, if is possible, show de cmd, without the dialog, only the cmd, without the close button, title....

basically an embedding a Console

Thanks (:
Posted
Updated 9-Jun-12 7:31am
v2
Comments
Sandeep Mewara 9-Jun-12 13:05pm    
I found some examples, but could not implement them in code
Please update the question wit what you tried and got stuck. Use 'Improve Question' link.
Alexandre Bencz 9-Jun-12 13:33pm    
ok (:
Jim Jos 10-Jun-12 3:06am    
You would like to run any command inside the command prompt? I presume you are using Visual C++.net 2008/2010 or VC++ 6.0 please confirm..

In C++, you can use the FindWindow, SetParent and SetWindowPos APIs as is used in the C# program.
Another way to do this is to use the AllocConsole API to create a console for the program.
 
Share this answer
 
A quick search turned up this article[^].
 
Share this answer
 
Comments
Alexandre Bencz 10-Jun-12 15:04pm    
Ok, but, if I need to open a program with TUI, like this:
http://i.imgur.com/zkC5V.png

?
Richard MacCutchan 11-Jun-12 4:03am    
What does this have to do with your original question? I have a suggestion: forget what you are trying to do and decide on a single model, either a console based application or a windows based application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900