something like this?
VB Code:
  1. Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  2. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  3. Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  4. Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  5. Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
  6. Private Sub Form_Load()
  7.     Dim MyStr As String
  8.     Dim dosHand As Long
  9.     dosHand = FindWindow("tty", vbNullString)
  10.     MyStr = String(GetWindowTextLength(dosHand) + 1, Chr$(0))
  11.     GetWindowText dosHand, MyStr, Len(MyStr)
  12.     AppActivate MyStr
  13.     SendKeys "%~"
  14.     AppActivate MyStr
  15.     End
  16. End Sub

?