Identifying/hooking to software

Hey guys,

As I said in my previous post I am a complete and utter noob when it comes to c++ but im learning as much as I can from articles and youtube and reading here/just playing around. I have a project that I am working on for myself and im just taking the first steps but need a bit of help.

I have a gui with one button on it , the buttons job is to identify a program , in this case the program is "Pokerstars" select a "Lobby" and then open that lobby. This is what the software looks like:

http://img703.imageshack.us/img703/4367/starssoftware.jpg

I have placed two red arrows to demonstrate the "lobbies" when you select one of them you either double click or hit return when one is highlighted to present you with the lobby window which looks like this:

http://img189.imageshack.us/img189/46/lobbywindow.jpg

So my first question is , how do I "hook" to just the pokerstars window in the first screen shot so that when I hit "return" or send a double click command to open the lobby it only sends that command inside of pokerstars window and not to potentially something else that could be open?

Second question would be do I just use the keyboard return as a kind of "sendkeys" to do this or a similar mouse click or is there an easier way?

Thanks,

Ben.


Last edited on
Any suggestions please?
One more up but I think this will have to stay outside of the beginners thread!
This should go in windows programming. More over this is a bit of tricky stuff.

What I will try to do is grab the focus and not let the focus lose. This is not hard to achieve on windows. I dont know which language you are using.
Hey thanks for the reply I will keep it in the Windows section,

Sorry I wasnt very specific. I am using c++ (visual studio 2010), by grabbing focus if i used mouseclicks and keystrokes does that mean they will only be used within the focus regardless of my actual mouse position if its elsewhere in the OS , e.g. if i was browsing or scrolling a webpage if I sent my program to mouseclick it would not affect my "real" mouse ?

So, are you using MFC ?

mouse click will work as usual because you cannot control the mouse movements. But what can be done is, by controlling focus the keystrokes can go to specific window. If some other window is gaining focus, lets say by mouse click, that windows should give focus to the window you want as default.

There may be other ways to do it which I am not aware of.
Topic archived. No new replies allowed.