This hides the windows, use 'ShowWindow(handle, SW_SHOW)' to show the windows again:
Declarations:
Code:
<Runtime.InteropServices.DllImport("USER32.DLL")> _
Public Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As UInteger) As Boolean
End Function
Public Const SW_HIDE As Integer = &H0
Public Const SW_SHOWNORMAL As Integer = &H1
Public Const SW_SHOWMINIMIZED As Integer = &H2
Public Const SW_SHOWMAXIMIZED As Integer = &H3
Public Const SW_SHOWNOACTIVATE As Integer = &H4
Public Const SW_SHOW As Integer = &H5
Public Const SW_MINIMIZE As Integer = &H6
Public Const SW_SHOWMINNOACTIVATE As Integer = &H7
Public Const SW_SHOWNA As Integer = &H8
Public Const SW_RESTORE As Integer = &H9
Private handle As IntPtr
Form Load or Timer Tick etc..:
Code:
For Each p As Process In Process.GetProcesses
If p.MainWindowTitle.Contains("Internet Explorer") Then
handle = p.MainWindowHandle
ShowWindow(handle, SW_HIDE)
End If
Next