Writing in to a specific window! Please help!

What I'm trying to do is simple, although it isnt.
What I want to do is write to an open window.
I want the user to be able to capture the window (by clicking on it after prompted)
I do not want to write to a file.
I do not want to open a new window.

I want my program(which is mostly written aside from this and one other issue) to prompt

"Bring the window you wish to output to the front"
the user then clicks the window, bringing it full screen (it is a game)

and then the program is attached to that window until the program(or the window) is closed(not minimized).
This is so that the program can send hotkeys to this program, much like a macro.

I've seen it done before, although that program is no longer available, hence why I'm remaking it.

I hope I have explained this well enough. Please tell me if you will require additional information.
Thank you.

~Newlance
closed account (o3hC5Di1)
Hi there,

Newlance wrote:
What I'm trying to do is simple, although it isnt.


Exactly, not so easy to do. The fact that you refer to "open windows" means your code will have to be written for the specific window manager you're using. If you're using Microsoft Windows, your code will have to be specific for that.

Then you will have to find a way to have your program send commands to other programs.

It sounds to me like you want to do stuff which this program provides: http://www.autohotkey.com/

Hope that helps.

All the best,
NwN
To specify, I'm running windows, 8 specifically.

Hotkeys and ezmacros are nice, but I'm building something that monitors the log files of the game, then acts once a command is recieved.
not something I know any macros can currently do.
I should add, I'm a programming student, working a bit above my class.

Its as important tome toknow HOWto do thisas itis justto get it done...
Thanks:)I
closed account (o3hC5Di1)
Sounds to me like you're wanting to write a bot? You should know that this is not really something that is encouraged on these forums.

However, the question apparently arose before on stackoverflow: http://stackoverflow.com/a/1032530
Perhaps that will get you on your way.

All the best,
NwN
Thanks. I will check thatout and retort back.
For now, here's some psudocode to showhow i think itSHOULD go. If someone couldcome alongand fix these mocked functions thatwould begreat
1
2
3
4
5
6
7
8
9
Cout << "bring targetwindow to front";
Do{
//do nothing
}while(focus==self);
Window win=getWindow("sb.exe);

Win >> "Text to be displayed in window";text
Cout
 


Please pardon obvious errors, i topped that frommy phoneI
looks like some good info. Thanks for pointing me in the right directionI.
It is a bot that I'm programming i suppose, however it's necessary step in a beta for an mmo I'm helping with. So I'm assure you thereus no ethical dilemma here.a
Last edited on
Topic archived. No new replies allowed.