Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#1.0 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 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 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 3 days ago
   
let me know if you want description.

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 446
1 OriginalGriff 325
2 Yogesh Kumar Tyagi 304
3 Maciej Los 235
4 Prakriti Goyal 200
0 OriginalGriff 6,417
1 Sergey Alexandrovich Kryukov 5,344
2 Maciej Los 3,434
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 21 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