Einzelnen Beitrag anzeigen

Benutzerbild von bitsetter
bitsetter

Registriert seit: 17. Jan 2007
1.169 Beiträge
 
Turbo Delphi für Win32
 
#13

Re: Tastendruck simulation nach eingabe im Editfeld?

  Alt 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;
  Mit Zitat antworten Zitat