Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Hide IE7 Webbrowser

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    159

    Resolved [RESOLVED] [2008] Hide IE7 Webbrowser

    I'm having difficulty figuring out hiding IE 7 window in VB.net
    and want to know if anyone knows how to do it correctly?

    I have an automation tool that uses the web browser and steals
    focus of any open windows, I thought of trying to hide the browser
    but I can't find anything on that using the search feature.

    Anyone have an idea?

    Chris

  2. #2
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: [2008] Hide IE7 Webbrowser

    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
    Did I help you with your problem? If I did rate me by clicking here: Rate knxrb

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    159

    Re: [2008] Hide IE7 Webbrowser

    Thanks my friend

    Just rated you!

    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width