detect whether ie is running or not

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajanji
    New Member
    • May 2008
    • 31

    detect whether ie is running or not

    I want to create a windows app which can display a message box whenever i open or close the internet explorer window. As the internet explorer window is opened a messagebox showing that "internet window is now opened" and when it is closed a msgbox showing "ie window is closed".
    Kindly help this newbie in writing the code for the same that how can my app made in vb.net detects that ie is opened.

    Thanx a million in advance.
    Regards,
    rajan arora
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello rajanji,

    Here is a start for you:

    Code:
        Function InternetExplorerRunning() As Boolean
            Dim a As Array = Process.GetProcesses(".")
            Dim proc As Process
            Dim ReturnThis As Boolean = False
    
            For Each proc In a
                If proc.ProcessName.ToString = "iexplore" Then
                    ReturnThis = True
                End If
            Next
    
            Return ReturnThis
        End Function
    Happy Coding,
    CroCrew~

    Comment

    • rajanji
      New Member
      • May 2008
      • 31

      #3
      Sir i have written this coding given by you in Form_Load() event and used a msgbox to show theat "IE running" and if returnthis = False then Msgbox says "IE not running" and its working like a charm but one thing more i want to do is that i want the msgbox saying "IE not running" when Internet explorer is closed and again when the Internet Explorer is opened a Msgbox appears saying "IE running" . This is not happening it appears only once while the application runs . After that while the application is running there are no msgboxes displaying "IE Running" or "IE not running" .
      How this can be done

      Thanks for your support in advance
      Regards,
      Rajan Arora

      Comment

      • sashi
        Recognized Expert Top Contributor
        • Jun 2006
        • 1749

        #4
        User timer to monitor if IE is running

        Comment

        • JamieHowarth0
          Recognized Expert Contributor
          • May 2007
          • 537

          #5
          A timer is perfect for this kind of thing, you need to poll the running process list regularly to test if iexplore.exe is present in the list.

          codegecko

          Comment

          Working...