Möchtest Du nicht lieber
@Command( [RunAgent] ; agent )
verwenden?
da wirst Du um SendKeys oder um die Schnittstelle von SimplyPhone nicht herum kommen.
In der Designer-Hilfe steht bei SendKeys zu dem Fehler:
SendKeys generates an "Illegal function call" error if string contains any of the following elements:
An unmatched parenthesis
An illegal key code
An illegal repeat count
Too many characters
Versuche mal per Win-Api die Tastenanschläge auszuführen
' Declarations
Const KEYEVENTF_KEYUP = &H2
Const VK_RETURN = &H0D
Const VK_MENU = &H12
Declare Sub KeyPress Lib "USER32" Alias "keybd_event" (Byval V As Integer, Byval S As Integer, _
Byval F As Long, Byval X As Long)
Sub Click(Source As Button)
KeyPress VK_MENU, 0, 0, 0
KeyPress Asc("k"), 0, 0, 0
KeyPress Asc("k"), 0, KEYEVENTF_KEYUP, 0
KeyPress VK_MENU, 0, KEYEVENTF_KEYUP, 0
KeyPress Asc("m"), 0, 0, 0
KeyPress Asc("m"), 0, KEYEVENTF_KEYUP, 0
End Sub
Nachteil funktioniert nicht im MAC- oder im Linux-Client.