Hello!
So I am trying to make program, that could go to a window (for example browser or text document) and write some text there. It sounds simple, so I tried to experiment, then googled for couple of hours. I know how to set position of cursor, so I can run program, make the window on top (for that part I use sleep and do it manually), move cursor to place where I want to write, simulate mouse click. And then.. I can do keystroke simulation, but I need like 100 symbols (including letters, numbers, space and etc.) and some numbers I would want to change. Like using cycle and everytime writing bigger number. And also I would want to take an answer to my program. Like copy a number from a certain place in screen. I can move cursor again, highlight it using double click. But then what?
If you have any advices please tell me. I'm newbie so I would prefer it as simple as possible. Like one command or something.
My program looks something like this:
1 2 3 4 5
Sleep(5000);
SetCursorPos(300, 300);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
// type some random text
P.S. I don't know if I should put it in beginners or windows programming section, but because it looks so simple I will put it into begginers. Sorry if I make mistake and please tell me if I need to put it to windows programming one. And if it's possible to do that too.
Oh, okay then. I know I can use string, but the thing is - how should I write it? Like ofstream, cout and stuff like that will put it out somewhere (console screen, some text file etc.), but if I want to write it to selected area, like I could do by pressing my keyboard keys. How to do that? The whole string thingy. Is there like different command (like cout or something) to do that?
By the way, thanks for the code. It's pretty interesting and usefull. It will save some time