Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# C#4.0 C#3.5 C#5 , +
Google Chrome places each tab into a separate process. Only the currently selected tab has it's Process.MainWindowTitle set to the current tab's title. The other tab's do not contain this information.
 
Is there a way to find out the Title of each tabs from the processes?
Posted 1-Jul-11 20:16pm
rus204682
Comments
TcJoshJohnson at 2-Jun-14 13:46pm
   
If I'm not mistaken, I think all tabs reside in the main UI process. Chrome spins up a new process to render the content of each tab and updates the UI through IPC. This was my understanding of the architecture anyway.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

sir, please see the below link. It might help you
 
http://stackoverflow.com/questions/18897070/getting-the-current-tabs-url-from-google-chrome-using-c-sharp[^]
 

 

 
thanks in advance
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
 
namespace Demo
{
    [SuppressUnmanagedCodeSecurity]
    internal static class UnsafeNativeMethods
    {
        //get title of the window

        #region Delegates
 
        public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);
 
        #endregion
 
        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        internal static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder lpString, int nMaxCount);
 
        //find the window handler.
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
 
        //hide the window.
        [DllImport("user32.dll")]
        internal static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
 
        //To get child window
        [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern IntPtr GetWindow(IntPtr hwnd, int wFlag);
 
        //To get child window
        [DllImport("user32")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
    }
}
  Permalink  
Comments
Amey K Bhatkar at 21-Jul-14 3:37am
   
let me know if you want description.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can enumerate all windows of the process and determine the main window (the main window usually has WS_CAPTION, WS_SYSMENU and other special styles). Then call GetWindowText() for that window to get its title.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

try this, hope it works..
 

Process[] processes = Process.GetProcessesByName("chrome");
string name = processes[i].MainWindowTitle;
  Permalink  
Comments
Valery Possoz at 21-Jun-14 6:01am
   
That does not work... only the active tab has it's MainWindowTitle set. All the other processes have an empty window title.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

I am not 100% sure if this is what you are looking for but I used it a couple of times.
http://stackoverflow.com/questions/16958051/get-chrome-browser-title-using-c-sharp
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 458
1 OriginalGriff 344
2 George Jonsson 233
3 Animesh Datta 130
4 Shemeemsha RA 128
0 OriginalGriff 6,179
1 Sergey Alexandrovich Kryukov 5,616
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 24 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100