Sign in to follow this  

Entering external text

This topic is 4341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for an advanced way to enter text into external programs. So.. if i have a console open asking the user to enter a string, while notepad is open, the string entered in the console program would be outputted to the notepad. I'm planning on using hooks to deal with the erasing and inputing methods but i'm not completely sure that's what hooks are for. I know they gather messages, so that if the user enters a certain amount of text into the string, the text would get inputed.. i think. Anyways, i'm just looking for a way to enter and remove text from an external program. Thanks in advanced.

Share this post


Link to post
Share on other sites
You could always use File I/O to write to the file and then use a system call to open the file in notepad. Other than that, you also have COM actions that you can use to communicate between programs, you'd just have to do a search to find out how to best achieve what you're looking for. I'm not sure about hooks, so I'll leave that to others, but that's my little thoughts.

My two cents, something to chew on,

Vopisk

Share this post


Link to post
Share on other sites
You can use SendMessage to output / receive information from Notepad in this case.

Something like this should work:

SendMessage(FindWindowEx(FindWindow("Notepad", NULL), NULL, "Edit", NULL), WM_SETTEXT, NULL, (LPARAM)"hello");


Share this post


Link to post
Share on other sites

This topic is 4341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this