Hi all,
how can I Simulate keystrokes for Warhammer Online (C / C++ / C# / VB.Net) ?
I found this Code in C++:
Code:
INPUT input;
memset(&input,0,sizeof(INPUT));
input.type=INPUT_KEYBOARD;
input.ki.wScan =0x0402;
input.ki.dwFlags=0;
SendInput(1,&input,sizeof(INPUT));
return 0;
but doesnt work.
I found this Code in Vb.Net:
Code:
Option Explicit Off
Public Class Form1
Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Long, ByRef pInputs As MyInput, ByVal cbSize As Long) As Long
Private Structure KEYBDINPUT
Dim wVk As Integer
Dim wScan As Long
Dim dwFlags As Long
Dim time As Long
Dim dwExtraInfo As Long
Dim unused1 As Long
Dim unused2 As Long
End Structure
Private Structure MyInput
Dim Type As Long
Dim ki As KEYBDINPUT
End Structure
Private Const KEYEVENTF_KEYUP As Long = &H2
Private Const INPUT_KEYBOARD As Long = 1
Private Const DIKEYBOARD_1 As Long = &H402 '0x0402
Private Sub Form_Load()
Dim inp As MyInput
inp.Type = INPUT_KEYBOARD
inp.ki.wScan = DIKEYBOARD_1
If Not press_key Then
inp.ki.dwFlags = KEYEVENTF_KEYUP
End If
SendInput(1, inp, Len(inp))
End Sub
End Class
but doesnt work.