i am wondering how to sendkeys into another program excpte making sendkeys to every app i open??
IN Vb8 btw
Printable View
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