Jump to content
  • Advertisement
Sign in to follow this  

9dragons keystroke program

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

1) sorry if i posted in the wrong section 2) i am new to this ,and i am tryng to make a program that will simulate the press of a button in 9dragons,but i have some problems,if i change the title in the code to notepad and open notepad it will type the numbers ,but it wont do anything in 9dragons,i replaced the keypress with a message that will confirm to me that i selected the 9dragons window and its working,but its not working with the keystroke,here is my code,i hope you can help me,thanks. the game is mayd in directx i think,but i am not shure,is there another way i can send keystrokes to the game thru directx? #include <string.h> #include <iostream> #include <windows.h> using namespace std; int main () { HWND window,hh,hw; int contor = 0; while (contor!=1) { hh = GetForegroundWindow(); hw = FindWindow("X3DKernel",NULL); if (hh=hw) contor = 1; } if (contor == 1) { for (int i=0;i<500;i++) { keybd_event(VkKeyScan('1'),0x02,0 , 0); keybd_event(VkKeyScan('1'),0x02, KEYEVENTF_KEYUP,0); Sleep(1500); keybd_event(VkKeyScan('5'),0x06,0 , 0); keybd_event(VkKeyScan('5'),0x06, KEYEVENTF_KEYUP,0); Sleep(3000); } system("pause"); } }

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!