Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

crzzymatt

sending commands to a game

This topic is 5575 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

yes im trying to make a program that is used to send mouse commands and key commands to a application (game). its going to be a macroing program. but i dont know how to send these commands. im prefering the commands to be sent, but the program im running them to doesnt have to be on top, meaning i can have it macro for me, while i am still able to look at web sites, and talk to people. thx

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
On windows you need to use PostMessage, EnumWindows and maybe EnumChildWindows. Look them up on MSDN. If you want to simulate mouse clicks then you are best to move the mouse pointer to the correct location, send a click (and then move it back again if appropriate). I have not found a nice and reliable way of doing it without doing this as many programs especially DX games have only one window

Hope this helps

Share this post


Link to post
Share on other sites
Look into the following:

SetCursorPos()
mouse_event()
keybd_event()

I''ve used them for something similar to what you describe, and they work very well.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!