Saturday, May 22, 2010

C++ Help [opening notepad]?

Ok so i am building a simple project. This is what i want to do. So the screan (cout) will print a list of options. one of the options is to write a note. if he types (cin) 3, a new notepad document will open up and he will be able to type whatever he want. SO how do i do this?????????? and how would i make it to were he can open a windows explorer to view all the notes he wrote????

C++ Help [opening notepad]?
#include %26lt;stdlib.h%26gt;


#include %26lt;stdio.h%26gt;


#include %26lt;iostream.h%26gt;





void main(void)


{char ch;


cout%26lt;%26lt;"1.calc\t2.notpad\n?";


ch=getche();


if (ch=="1") system("notepadexe");


if (ch=="2") system("calc.exe");





}





/* remember: make exe of this file, and run it from OS(windows,Dos) not from Turbo C++*/
Reply:http://forums.microsoft.com/MSDN/ShowPos...
Reply:These steps will help u accomplish your task


1 - Include the header file DOS.H in your program


2 - Pass the 'notepad' command to the shell using any of the command passing functions defined in it. ( This will open notepad when the user types 3 )


3 - Define a specific directory for the storage of his notes and open it when you want to view all his notes


No comments:

Post a Comment