avoid killing processes - it causes memory leaks. Just loop through the windows and close them:VB Code:
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 Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _ ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Const WM_CLOSE As Long = &H10 Private Sub Command1_Click() Dim lhWnd As Long Do lhWnd = FindWindowEx(0&, lhWnd, "IEFrame", vbNullString) If lhWnd Then PostMessage lhWnd, WM_CLOSE, 0&, 0& Loop While lhWnd End Sub




Reply With Quote