Hallo,
Hab mir eine kleine Tastatur geschrieben, dass Zielfenster ist eigentlich eine Variable, dass hab ich auch getestet das das wirklich der Fall ist, aber irgendwie klappt’s trotzdem nur mit Editor…?
Weiß jemand woran das liegt???
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tastatur", 583, 250, 192, 124)
$q = GUICtrlCreateButton("q", 16, 80, 35, 33, $WS_GROUP)
$w = GUICtrlCreateButton("w", 48, 80, 35, 33, $WS_GROUP)
$e = GUICtrlCreateButton("e", 80, 80, 35, 33, $WS_GROUP)
$r = GUICtrlCreateButton("r", 112, 80, 35, 33, $WS_GROUP)
$t = GUICtrlCreateButton("t", 144, 80, 35, 33, $WS_GROUP)
$z = GUICtrlCreateButton("z", 176, 80, 35, 33, $WS_GROUP)
$u = GUICtrlCreateButton("u", 208, 80, 35, 33, $WS_GROUP)
$i = GUICtrlCreateButton("i", 240, 80, 35, 33, $WS_GROUP)
$o = GUICtrlCreateButton("o", 272, 80, 35, 33, $WS_GROUP)
$p = GUICtrlCreateButton("p", 304, 80, 35, 33, $WS_GROUP)
$a = GUICtrlCreateButton("a", 32, 112, 35, 33, $WS_GROUP)
$s = GUICtrlCreateButton("s", 64, 112, 35, 33, $WS_GROUP)
$d = GUICtrlCreateButton("d", 96, 112, 35, 33, $WS_GROUP)
$f = GUICtrlCreateButton("f", 128, 112, 35, 33, $WS_GROUP)
$g = GUICtrlCreateButton("g", 160, 112, 35, 33, $WS_GROUP)
$h = GUICtrlCreateButton("h", 192, 112, 35, 33, $WS_GROUP)
$j = GUICtrlCreateButton("j", 224, 112, 35, 33, $WS_GROUP)
$k = GUICtrlCreateButton("k", 256, 112, 35, 33, $WS_GROUP)
$l = GUICtrlCreateButton("l", 288, 112, 35, 33, $WS_GROUP)
$Leertaste = GUICtrlCreateButton("Leertaste", 24, 176, 297, 33, $WS_GROUP)
$y = GUICtrlCreateButton("y", 48, 144, 35, 33, $WS_GROUP)
$x = GUICtrlCreateButton("x", 80, 144, 35, 33, $WS_GROUP)
$c = GUICtrlCreateButton("c", 112, 144, 35, 33, $WS_GROUP)
$v = GUICtrlCreateButton("v", 144, 144, 35, 33, $WS_GROUP)
$b = GUICtrlCreateButton("b", 176, 144, 35, 33, $WS_GROUP)
$n = GUICtrlCreateButton("n", 208, 144, 35, 33, $WS_GROUP)
$m = GUICtrlCreateButton("m", 240, 144, 35, 33, $WS_GROUP)
$endern = GUICtrlCreateButton ("Zielfenster festlegen", 460, 30, 110, 33, $WS_GROUP )
$grossKlein = GUICtrlCreateButton ("^", 510, 210, 60, 33, $WS_GROUP )
$Enter = GUICtrlCreateButton ("Enter", 273, 144, 60, 33, $WS_GROUP )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $endern
$InPUT = InputBox ( "Zielfenster festlegen", "Legen sie hier ihr Zielfenster fest, bitte achten sie darauf, dass sie den Fenster Titel richtig schreiben." )
Case $grossKlein
ControlSend ( $InPUT&"", "", "Edit1", "{CAPSLOCK on}", 0 )
Case $Enter
ControlSend ( $InPUT&"", "", "Edit1", "{ENTER}", 0 )
Case $Leertaste
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", " ", 0 )
EndIf
case $a
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "a", 0 )
EndIf
Case $b
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "b", 0 )
EndIf
Case $c
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "c", 0 )
EndIf
Case $d
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "d", 0 )
EndIf
Case $e
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "e", 0 )
EndIf
Case $f
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "f", 0 )
EndIf
Case $g
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "g", 0 )
EndIf
Case $h
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "h", 0 )
EndIf
Case $i
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "i", 0 )
EndIf
Case $j
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "j", 0 )
EndIf
Case $k
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "k", 0 )
EndIf
Case $l
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "l", 0 )
EndIf
Case $m
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "m", 0 )
EndIf
Case $n
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "n", 0 )
EndIf
Case $o
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "o", 0 )
EndIf
Case $p
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "p", 0 )
EndIf
Case $q
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "q", 0 )
EndIf
Case $r
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "r", 0 )
EndIf
Case $s
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "s", 0 )
EndIf
Case $t
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "t", 0 )
EndIf
Case $u
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "u", 0 )
EndIf
Case $v
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "v", 0 )
EndIf
Case $w
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "w", 0 )
EndIf
Case $x
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "x", 0 )
EndIf
Case $y
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "y", 0 )
EndIf
Case $z
if(WinActivate ( $InPUT&"")) Then
ControlSend ( $InPUT&"", "", "Edit1", "z", 0 )
EndIf
EndSwitch
WEnd