Public Group

# 9dragons keystroke program

This topic is 3754 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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"); } } 

• 10
• 17
• 9
• 14
• 41
• ### Forum Statistics

• Total Topics
631067
• Total Posts
2997738
×