Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hello World

1 view
Skip to first unread message

Sourcerer

unread,
Feb 23, 2007, 4:28:21 AM2/23/07
to
I'm making a "hello world" program in C#, though a bit more complex one.

When I click on a button in my program, it is supposed to open a program (say,
Notepad) - that I did, by opening Notepad as another process. using Process
class.

Clicking another button, my program should make "Hello World!" appear in notepad
it's previously opened.

How can I do that?

--
"It is easy in the world to live after the world's opinion; it easy in solitude
to live after our own; but the great man is he who in the midst of the crowd
keeps with perfect sweetness the independence of solitude."
Ralph Waldo Emerson, Self-reliance 1841
http://pinpoint.wordpress.com/

rossum

unread,
Feb 23, 2007, 8:49:33 AM2/23/07
to
On Fri, 23 Feb 2007 10:28:21 +0100, "Sourcerer"
<enl...@MAKNIgmail.com> wrote:

>I'm making a "hello world" program in C#, though a bit more complex one.
>
>When I click on a button in my program, it is supposed to open a program (say,
>Notepad) - that I did, by opening Notepad as another process. using Process
>class.
>
>Clicking another button, my program should make "Hello World!" appear in notepad
>it's previously opened.
>
>How can I do that?

You probably can't. What you can do is to open a new copy of Notepad
with a selected textfile loaded by including the name of the textfile
as an argument when you fire up Notepad:

ProcessStartInfo PSI = new ProcessStartInfo();
PSI.FileName = "notepad.exe";
PSI.Arguments = "hello.txt";
Process.Start(PSI);

rossum

rh

unread,
Feb 25, 2007, 5:28:00 PM2/25/07
to
It's not the easiest thing to do. You could probably do it by using the
SendMessage windows API and send keystrokes to notepad.


"Sourcerer" <enl...@MAKNIgmail.com> wrote in message
news:ermc36$mdo$1...@ss408.t-com.hr...

0 new messages