the system() function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

the system() function

yanghui1023yanghui1023 Posts: 24Member
I've used the system funtion in stdlib.h but when I use it to run an executive file,the DOS window appears.How can I remove the DOS window?

eg,I've achieved a player and a caculator& and a dialog with 2 buttons,when I click button1,then I want the player appear,and so dose with the caculator when I click button2.So in the message process funtion of button1 I used system() to run the executive file of player.
the main code is:

void CProjectDlg::Onplayer()
// TODO: Add your command handler code here
system("player");/* player is the name of the player's
executive file */
system("exit"); // i want to exit from dos window bu failed.

void CProjectDlg::Oncaculator()
// TODO: Add your command handler code here

Is anyone knows how to remove the Dos window thanks.
Yang Hui


Sign In or Register to comment.