Ok I had this working before but then formatted my computer and forgot all about the source so now I am remaking it but for some reason it wont type anything, I swear I think im missing a declaration but im not sure and it does set the wndow as forground just doesnt type :-\


VB Code:
  1. Private Declare Function SetForegroundWindow Lib "user32" _
  2. (ByVal hwnd As Long) As Long
  3. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  4.  
  5.  
  6. Private Sub Command1_Click()
  7. Dim WinWnd As Long, Ret As String, RetVal As Long, lpClassName As String
  8. Ret = "Xx ThA gRiM xX : Xx ThA gRiM xX - Instant Message"
  9.     WinWnd = FindWindow(vbNullString, Ret)
  10.     SetForegroundWindow WinWnd
  11.     If WinWnd Then SendKeys ("Testing Testing Test Test Testing Boo! {ENTER} {ESC}")
  12.  
  13. End Sub