Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to write C# code that inserts text into an open instance of WordPad? Thank you.
Posted
Updated 30-May-10 12:41pm
v5
Comments
Moak 30-May-10 18:41pm    
Updated subject, text and tags, good luck!

Go back to old-fashioned windows programming and use the SendKeys class - it's always very exciting to see where the output actually ends up.
 
Share this answer
 
You want to write C# code that inserts text into an open instance of wordpad ? Judging from the subject you chose for your post, I'd say that this is completely beyond you. You should buy a basic 'for dummies' C# book and work through it, then move on when you have some basic programing skills. Even then, the task, if I get it right, can only be done via hacks that are not reliable, or recommended. Why would you want to do such a thing ?
 
Share this answer
 
Comments
charles henington 1-Jun-10 9:34am    
Reason for my vote of 1
add positive to post everyone was beginer at some point think back to your first app
As baconbutty said, you'll need to use the methods within the user32 library. But, I would also guess that this is a bit advanced for you, though a little help in google can do it.

You'd have to first find the handle for the window, then use SendKeys to send the text to it. It can be done, but you'll have to do some research (google). Since I don't know straight off the top of my head how to do that, and since doing the research won't help me in anyway, it's up to you to do it.

Look at the list here: API calls list (USER32.DLL)[^]
 
Share this answer
 

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