something like this?
VB Code:
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long Private Sub Form_Load() Dim MyStr As String Dim dosHand As Long dosHand = FindWindow("tty", vbNullString) MyStr = String(GetWindowTextLength(dosHand) + 1, Chr$(0)) GetWindowText dosHand, MyStr, Len(MyStr) AppActivate MyStr SendKeys "%~" AppActivate MyStr End End Sub
?




Reply With Quote