
Originally Posted by
dr3vi1
Yes Putty always has the Same Window Caption, by window caption you mean the title in the top of the window, correct? Like the title in the top left of the Man I can't believe the responce of this forum, Thanks everyone.
Yep, thats what I mean. This should fix you up.
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const WM_CLOSE = &H10
Private Sub cmdCloseApp_Click()
Dim lngCloseIt As Long
lngCloseIt = FindWindow(vbNullString, "Caption Of Window To Be Closed")
PostMessage CloseIt, WM_CLOSE, CLng(0), CLng(0)
End Sub