Registriert seit: 17. Jan 2007
1.169 Beiträge
Turbo Delphi für Win32
|
Re: Tastendruck simulation nach eingabe im Editfeld?
17. Jan 2007, 20:13
Versuche es mal hiermit!
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
c: Char;
i: integer;
begin
if length(Edit1.Text)> 0 then
begin
for i:= 0 to length(Edit1.Text) do
begin
c:= Edit1.text[i];
Case c of
'1'..'9' :
begin
keybd_event(ord(c),0,0,0);
keybd_event(ord(c),0,keyeventf_keyup,0);
end;
'A'..'Z':
begin
keybd_event(vk_Shift,0,0,0);
keybd_event(ord(c),0,0,0);
keybd_event(vk_Shift,0,keyeventf_keyup,0);
keybd_event(ord(c),0,keyeventf_keyup,0);
end;
'a'..'z':
begin
c:= upcase(c);
keybd_event(ord(c),0,0,0);
keybd_event(ord(c),0,keyeventf_keyup,0);
end;
else
begin
keybd_event(ord(c),0,0,0);
keybd_event(ord(c),0,keyeventf_keyup,0);
end;
end;
end;
end;
end;
|
|
Zitat
|