Jump to content
  • Advertisement
Sign in to follow this  
aphex3k

DirectX // DirectInput send Mouse Event

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

Hey folks, I am a programmer by heart and studied applied computer science. I tried several different programming-languages and scripting languages and this time i arrived at C# incorporating DirectX, especially DirectInput. I want to write an auto-login application for a directx game which does not offer this functionality on its own. So what i want to acomplish is a small app that moves the curser across the screen, then sends (left mouse buttons) LMB events and inserts keystrokes. As far as i am for now i can initialize and acquiere my mouse device through direct input. I can move my cursor across the screen, no problem. But now Im kind of stuck. I don't know how to tell the game that the left mouse button would be clicked. In normal win32.forms apps i could use the user32.dll function but this does not work in my game. As i am new to DirectX it may be enough to point me into the right direction, so i know where to look.

Share this post


Link to post
Share on other sites
Advertisement
Well, I don't think you can use direct input for this (I might be wrong about that).

But, you should be able to send standard windows mouse and key messages to the game window that you are trying to control.

You should be able to get the HWND of the game window, and then use SendMessage() to provide the mouse clicks and keyboard input.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!