Autor Beitrag
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Di 26.10.04 09:05 
Hi,
wie kann ich einen Tastendruck simulieren?
Scorp
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Di 26.10.04 09:07 
ausblenden Delphi-Quelltext
1:
PostMessage(Zielfenster.Handle,WM_KEYDOWN,Keycode,0);					


Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
ScorpionKing Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Di 26.10.04 09:12 
gab es da net ma ne funktion keyboard_event oder so? die würd ich gern benutzen, aber bei meinem delphi gibt es die irgendwie net. wird die vielleicht anders geschrieben?
ScorpionKing Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Di 26.10.04 09:13 
habs gefunden: keybd_event

Thankx
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 26.10.04 09:16 
Ja was denn nun? Funktion oder Event?
Wenn du etwas brauchst, dass ein Keyboard-Event auslöst, dann nimm das von .Chef. Kannst dir ja eine Funktion draus machen.
Events für die Tastatur gibt es einige: OnKeyDown, OnKeyPress, OnKeyUp.
Schau einfach mal in den Objektinspektor unter Ereignisse.

EDIT: zu langsam.
noctua
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 170



BeitragVerfasst: Di 07.12.04 20:22 
.Chef hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
PostMessage(Zielfenster.Handle,WM_KEYDOWN,Keycode,0);					


Gruß,
Jörg


woher weiss ich wie das fenster heisst?

also mein programm heisst hallo.exe


ps: wie ist das tastenkürzel für Alt+S ?

_________________
Am ende sterben eh alle ................
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 07.12.04 20:54 
Bei Alt würdeich mal nach WM_SYSKEYDOWN nachsehen!
noctua
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 170



BeitragVerfasst: Di 07.12.04 21:01 
sry aber ich weiss nicht was das ist .... in der suche find ich auch nichts, aber gibts da nicht sowas wie #13?

_________________
Am ende sterben eh alle ................
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Di 07.12.04 21:30 
Das handle des Fensters oder der Komponente bekommst du mit x-Spy.
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Di 07.12.04 23:59 
Ein externes Programm wird dir beim Programmieren nicht viel nützen. Schau mal in der API-Hilfe nach FindWindow bzw. FindWindowEx.

Und nochwas: Alt+S ist eine Tastenkombination, und die zu senden ist nicht so einfach wie eine einzelne Taste. Ich kann den Code morgen mal raussuchen (will jetzt den anderen Rechner nicht nochmal hochfahren und das SDC ist down :-( ).

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mi 08.12.04 15:54 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
keybd_event(VK_CONTROL,MapVirtualKey(VK_CONTROL,0),0,0);
keybd_event(Ord('V'),MapVirtualKey(Ord('V'),0),0,0);
keybd_event(Ord('V'),MapVirtualKey(Ord('V'),0),KEYEVENTF_KEYUP,0);
keybd_event(VK_CONTROL,MapVirtualKey(VK_CONTROL,0),KEYEVENTF_KEYUP,0);


das sollte Strg+V simulieren :roll:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)