Hiho,
Ich probiere Die Pfeiltaste nach oben an ein Spiel zu senden!
Das ganze funktioniert eigendlich auch ganz gut nur Im Spiel klappt es nicht...
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49:
| procedure SendKeys(Key: Integer); begin Keybd_Event(Key, MapVirtualKey((Key),1), 0, 0); Keybd_Event(Key, MapVirtualKey((Key),1), KEYEVENTF_KEYUP, 0); end;
procedure TForm1.Button1Click(Sender: TObject); var Wnd: hWnd; begin Wnd := FindWindow(Nil, 'Fette Sau'); ShowMessage(IntToStr(Wnd)); end;
procedure TForm1.Button2Click(Sender: TObject); begin timer1.Enabled := false; end;
procedure TForm1.Timer1Timer(Sender: TObject); var Wnd: hWnd; begin Wnd := FindWindow(Nil, 'Fette Sau'); SetForeGroundWindow(Wnd); SendKeys(VK_UP); end;
procedure TForm1.Timer2Timer(Sender: TObject); begin If (GetAsyncKeystate(VK_F5))<>0 Then begin timer1.Enabled := true; end;
If (GetAsyncKeystate(VK_F6))<>0 Then begin timer1.Enabled := false; end; end;
end. |
Ich hab es auch schon über Tasten probiert (F5 und F6 zum starten und stoppen)
aber das ganze will irgendwie nicht.
Hat vll jmd eine Lösung parat?
Gruß crAzywuLf
