How To Snedkeys To another program

Posts 1–2 of 2 · Page 1 of 1
How To Snedkeys To another program
i am wondering how to sendkeys into another program excpte making sendkeys to every app i open??

IN Vb8 btw
Maybe something like this.

[php]
Private Declare Function GetForegroundWindow Lib "user32" () As Int32
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal IpString As String, ByVal cch As Int32) As Int32
Private Function GetActiveWindowTitle() As String
Dim Str As String = New String(Chr(0), 100) GetWindowText(GetForegroundWindow, Str, 100) Str = Str.Substring(0, InStr(Str, Chr(0)) - 1)
Return Str
End Function
[/php]
And add this to a timer:
Code:
textbox1.text = GetActiveWindowTitle()
If textbox1.text = "Title or your program etc." then 
sendkeys.send(.....)

End if
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us