How to open notepad.exe
-
Hi! Does somebody know, how to to open notepad.exe? In the opened notepad's page, the user should be able to write, save and close the file. Would be great, if somebody could help me with this problem.:)
Take a look at ShellExecute[^]
-
Take a look at ShellExecute[^]
-
Hi! Thanks, that was a big help. Maybe you can tell me, too, how to insert text of a CString-object in the already opened notepad-File? Or do I have to do this at the same time and if yes: how? With best regards,:-D Hanno
I don't know if this is possible. However, what you could to is first, save your text into a text file, then open this file in notepad with ShellExecute. But, why exactly do you want to have such a thing ? Maybe there is another solution that is better.
-
Hi! Thanks, that was a big help. Maybe you can tell me, too, how to insert text of a CString-object in the already opened notepad-File? Or do I have to do this at the same time and if yes: how? With best regards,:-D Hanno
you cannot directly interract with the notepad content. however,you could write your string (CString object content) into a file that you pass to notepad as a command line parameter so that it is opened when notepad is launched.
::ShellExecute(this, "open", "notepad.exe", "myfile", NULL, SW_SHOW);
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -
I don't know if this is possible. However, what you could to is first, save your text into a text file, then open this file in notepad with ShellExecute. But, why exactly do you want to have such a thing ? Maybe there is another solution that is better.
I want to have such a thing, because there are points to display on a window. There is a function, responsible for displaying the points. Of course, the function needs coordinates. First of all, this function gets the point names from the calling program. THen, the function is looking for fitting coordinates, which should be in a already existing text-file. But it can happen, that the coordinate-file will be empty. Then, the function has to open a notepad-file, where the point-names should be already inserted. The user has to write down the missing coordinates for the point-names. That's the way. Maybe you have a better idea to do this? Hanno
-
I want to have such a thing, because there are points to display on a window. There is a function, responsible for displaying the points. Of course, the function needs coordinates. First of all, this function gets the point names from the calling program. THen, the function is looking for fitting coordinates, which should be in a already existing text-file. But it can happen, that the coordinate-file will be empty. Then, the function has to open a notepad-file, where the point-names should be already inserted. The user has to write down the missing coordinates for the point-names. That's the way. Maybe you have a better idea to do this? Hanno
Err...:~ Honnestly, I don't think notepad is the right tool for doing that. Why don't you simply ask for this data in a program of your own (either a separate or even in your existing application) ? Then save the data in a file and its done. Why do you want to use notepad for that ?
-
Err...:~ Honnestly, I don't think notepad is the right tool for doing that. Why don't you simply ask for this data in a program of your own (either a separate or even in your existing application) ? Then save the data in a file and its done. Why do you want to use notepad for that ?
Cedric Moonen wrote:
Honnestly, I don't think notepad is the right tool for doing that.
I concur. It's the old square-peg-in-a-round-hole paradigm.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
Cedric Moonen wrote:
Honnestly, I don't think notepad is the right tool for doing that.
I concur. It's the old square-peg-in-a-round-hole paradigm.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
But it works that way. It is not my idea to do it this way, maybe that makes you a little bit happier? Best regards, Hanno
hanno25 wrote:
It is not my idea to do it this way
Let me guess: it's your boss's idea :-D
-
Hi! Does somebody know, how to to open notepad.exe? In the opened notepad's page, the user should be able to write, save and close the file. Would be great, if somebody could help me with this problem.:)
Another idea that comes to mind would be to use the Windows clipboard. What you could do in your program is launch notepad.exe. Your app could place the text content on the clipboard and then send messages to the notepad window to paste the text into it's edit window. For more info on how to use the Windows clipboard, look up the SetClipboardData function on MSDN and/or take a look at this CodeProject article[^] It doesn't really make sense as to why you can't just write your data straight out to a text file from within your program.