Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7771503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:40:07+00:00 2026-06-01T16:40:07+00:00

When accessing Process.MainWindowTitle as follows… Process[] processes = Process.GetProcessesByName( iexplore ); …and then loop

  • 0

When accessing Process.MainWindowTitle as follows…

Process[] processes = Process.GetProcessesByName( "iexplore" );

…and then loop over the resulting array, I always end up with the MainWindowTitle being empty for all but one item in the array. In my case I’ve got two Internet Explorer windows open, one with a single tab and one with two tabs in it.

Running my code I always get the MainWindowTitle for the window and tab that I had last active – all the others remain empty. The strange thing is that the process ID in which the MainWindowTitle is filled is always the same – if I activate the other IE window or tab before running my code, the process ID is always the same:

  if ( !processes.Any() )
  {
    MessageBox.Show( "TODO - No matching process found" );
    return;
  }

  if ( processes.Count() > 1 )
  {
    foreach ( Process currentProcess in processes )
    {
      // More than one matching process found
      checkedListBox1.Items.Add( currentProcess.Id + " - " + currentProcess.MainWindowTitle + " - " + currentProcess.ProcessName );
    }

    return;
  }

Output could therefore be for the first run like:

  • 4824 – – iexplore
  • 3208 – – iexplore
  • 4864 – Google – Windows Internet Explorer – iexplore

Next run (with the other IE window selected beforehand):

  • 4824 – – iexplore
  • 3208 – – iexplore
  • 4864 – id Software – Windows Internet Explorer – iexplore

I’ve read about this post, but I didn’t get any further with my problem (and it seems to go into a somewhat different direction anyway).

Why do I always only get one non-empty MainWindowTitle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:40:08+00:00Added an answer on June 1, 2026 at 4:40 pm

    One option to make this happen reliabely (see comments above) is to implement a BHO – esp. the DWebBrowserEvents2::WindowStateChanged Event is usefull in this scenario.

    BHOs are implementations of a bunch of COM interfaces and get loaded into the browser process/each tab… best way to implement them is in C++ IMO.

    But it is certainly possible to do so in .NET (although not recommended):

    • http://www.codeproject.com/Articles/350432/BHO-Development-using-managed-code
    • http://www.codeguru.com/csharp/.net/net_general/comcom/article.php/c19613/Build-a-Managed-BHO-and-Plug-into-the-Browser.htm
    • AddIn-Express for IE (commercial library for .NET-based BHOs)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using accessing thorough DBUS from some process. The trouble is that it runs
Question: What is the standard method for accessing back end data, which logon should
For an application I'm writing, I want to know which all processes are accessing
I'm trying to automate the process of accessing libraries in the framework I use
I've got 3 different clients accessing my ASP.Net service layer. I'm in the process
I am in the process of switching over a control from a GridView to
I have problems accessing the process command line from Linux 64 bit Assembly program.
Is there a bug in PowerShell's Start-Process command when accessing the StandardError and StandardOutput
Is accessing a bool field atomic in C#? In particular, do I need to
When accessing an object in a DataTable retrieved from a database, are there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.