if IE is running

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QmVu?=

    #1

    if IE is running

    Is there a way, with either VB 2005 express or vb 2008 express, to tell if IE
    is running and to be able to close it from with my application. I already
    know how to start IE, what I want is to be able to to detect if IE is running
    and to be able to close or open IE as needed.
    I do not want to kill the IE process, just to be able to close it.
  • Spam Catcher

    #2
    Re: if IE is running

    =?Utf-8?B?QmVu?= <Ben@discussion s.microsoft.com wrote in
    news:2E81350F-B86D-44D4-B4F2-D4D2D67E3AC2@mi crosoft.com:
    Is there a way, with either VB 2005 express or vb 2008 express, to
    tell if IE is running and to be able to close it from with my
    application. I already know how to start IE, what I want is to be able
    to to detect if IE is running and to be able to close or open IE as
    needed. I do not want to kill the IE process, just to be able to close
    it.
    Using the IE API you can loop through all the windows:

    Dim _IEWindows As SHDocVw.ShellWi ndows = New SHDocVw.ShellWi ndowsClass

    For Each IE As SHDocVw.Interne tExplorer In _IEWindows
    'Do something here
    Next

    You need to reference ShDocVw which is the Internet Explorer COM object.

    Comment

    • rowe_newsgroups

      #3
      Re: if IE is running

      On Aug 26, 3:02 am, Spam Catcher <spamhoney...@r ogers.comwrote:
      =?Utf-8?B?QmVu?= <B...@discussio ns.microsoft.co mwrote innews:2E81350F-B86D-44D4-B4F2-D4D2D67E3AC2@mi crosoft.com:
      >
      Is there a way, with either VB 2005 express or vb 2008 express, to
      tell if IE is running and to be able to close it from with my
      application. I already know how to start IE, what I want is to be able
      to to detect if IE is running and to be able to close or open IE as
      needed. I do not want to kill the IE process, just to be able to close
      it.
      >
      Using the IE API you can loop through all the windows:
      >
      Dim _IEWindows As SHDocVw.ShellWi ndows = New SHDocVw.ShellWi ndowsClass
      >
      For Each IE As SHDocVw.Interne tExplorer In _IEWindows
      'Do something here
      Next
      >
      You need to reference ShDocVw which is the Internet Explorer COM object.
      Or using the Window's API you could use the FindWindow method and grab
      the internet explorer windows from there. Though I like the use of the
      IE API approach much better.

      Thanks,

      Seth Rowe

      Comment

      • =?Utf-8?B?QmVu?=

        #4
        Re: if IE is running

        Thanks
        I am in the process of trying your suggestion. So far when I run the
        application, I am getting 2 system - collect showing up in a listbox when no
        IE window is open and 3 with 1 window open and so on. Also, I need to work on
        getting the friendly name for IE and how to actually close the open window(s)
        Thanks again

        "Spam Catcher" wrote:
        =?Utf-8?B?QmVu?= <Ben@discussion s.microsoft.com wrote in
        news:2E81350F-B86D-44D4-B4F2-D4D2D67E3AC2@mi crosoft.com:
        >
        Is there a way, with either VB 2005 express or vb 2008 express, to
        tell if IE is running and to be able to close it from with my
        application. I already know how to start IE, what I want is to be able
        to to detect if IE is running and to be able to close or open IE as
        needed. I do not want to kill the IE process, just to be able to close
        it.
        >
        Using the IE API you can loop through all the windows:
        >
        Dim _IEWindows As SHDocVw.ShellWi ndows = New SHDocVw.ShellWi ndowsClass
        >
        For Each IE As SHDocVw.Interne tExplorer In _IEWindows
        'Do something here
        Next
        >
        You need to reference ShDocVw which is the Internet Explorer COM object.
        >

        Comment

        • Michel Posseth  [MCP]

          #5
          Re: if IE is running


          it might be simpler to use the process class

          just loop through all the running processes and kill the process if it is a
          IE instance



          "Ben" <Ben@discussion s.microsoft.com schreef in bericht
          news:D6375A97-6167-410D-81A3-5664F0528FBA@mi crosoft.com...
          Thanks
          I am in the process of trying your suggestion. So far when I run the
          application, I am getting 2 system - collect showing up in a listbox when
          no
          IE window is open and 3 with 1 window open and so on. Also, I need to work
          on
          getting the friendly name for IE and how to actually close the open
          window(s)
          Thanks again
          >
          "Spam Catcher" wrote:
          >
          >=?Utf-8?B?QmVu?= <Ben@discussion s.microsoft.com wrote in
          >news:2E81350 F-B86D-44D4-B4F2-D4D2D67E3AC2@mi crosoft.com:
          >>
          Is there a way, with either VB 2005 express or vb 2008 express, to
          tell if IE is running and to be able to close it from with my
          application. I already know how to start IE, what I want is to be able
          to to detect if IE is running and to be able to close or open IE as
          needed. I do not want to kill the IE process, just to be able to close
          it.
          >>
          >Using the IE API you can loop through all the windows:
          >>
          >Dim _IEWindows As SHDocVw.ShellWi ndows = New SHDocVw.ShellWi ndowsClass
          >>
          >For Each IE As SHDocVw.Interne tExplorer In _IEWindows
          > 'Do something here
          >Next
          >>
          >You need to reference ShDocVw which is the Internet Explorer COM object.
          >>

          Comment

          Working...