Autor Beitrag
crazywulf
Hält's aus hier
Beiträge: 13

Win XP
BD S2006, PHP, HTML, MYSQL
BeitragVerfasst: Mi 11.07.07 17:22 
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...

ausblenden volle Höhe Delphi-Quelltext
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
  // Stop := False;
  Wnd := FindWindow(Nil, 'Fette Sau');
  // if Wnd <> 0 then
  //begin
  //  SetForeGroundWindow(Wnd);
  //  sleep(5000);
  //  timer1.Enabled := true;
 // end;
  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 :D
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 22.07.07 06:59 
Das Fenster wird gefunden?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)