Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Fr 20.06.03 21:33 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Timer1Timer(Sender: TObject);
var x:integer;
    y:word;
    zuschicken,y2:string;
    WHandle: THandle;
begin
   zuschicken:=TextSenden.text;
   WHandle := getforegroundwindow;
   BringWindowToTop(WHandle);
   for x := 1 to length(zuschicken) do begin
       y2:=zuschicken;
       delete(y2,x+1,length(y2));
       while length(y2) > 1 do delete(y2,1,1);
       y:= strtoword(y2);
       keybd_event(VkKeyScan(chr(y)),0,0,keyeventf_keyup);
end;
end;


Wenn man in TextSenden.Text groß und klein geschrieben hat kopiert er jedoch immer nur klein und die groß buchstaben werden ins kleine übersetzt.
Ich möchte aber das er alle Zeichen kopieren kann.
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Mo 23.06.03 12:19 
Titel: Groß- und Kleinschreibung möglich
Hallo,

hab ein wenig rumprobiert und bin auf folgenden Code gekommen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Timer1Timer(Sender: TObject);
var x : integer;
    zuschicken, y2 : string; 
    Whandle : THandle; 
begin
  zuschicken:=TextSenden.text;
  Whandle:=getforegroundwindow;
  BringWindowToTop(WHandle);
  for x:=1 to length(zuschicken) do
  begin
    y2:=zuschicken;
    if VkKeyScan(y2[x])>255 then
    begin
      keybd_event(VK_SHIFT, 0, 0, 0);
      keybd_event(VkKeyScan(y2[x]), 0, 0, 0);
      keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
    end
    else keybd_event(VkKeyScan(y2[x]), 0, 0, KEYEVENTF_KEYUP);
  end;
end;

Damit müßte Dir geholfen sein.

Gruß,

Adrian
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Mo 23.06.03 13:34 
THX so läuft es