Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

given InternetExplorer object, how do you get it's text in titlebar?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sean_n - 17 Mar 2008 00:51 GMT
The following code below loops through all InternetExplorer objects
and sets the TitleBar to 0--thus hiding all the toolbars.  What I
really want is to hide the toolbar only if the text in the titlebar is
set to something.  Given InternetExplorer object, how do you get it's
text in the titlebar?

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using SHDocVw;
using Shell32;

namespace hidetoolbar
{
  class Program
  {
     //These are class data members
     static private SHDocVw.InternetExplorer m_IExplorer = null;
     static private IWebBrowserApp m_WebBrowser = null;

     public static void Main(string[] args)
     {
        ShellClass shell = new Shell32.ShellClass();
        ShellWindows ies = (ShellWindows)shell.Windows(); //IE
windows.
        InternetExplorer ie;
        for (int i = 0; i < ies.Count; i++)
        {
           ie = (InternetExplorer) ies.Item(i);
//
//  Need to find a way to check the Titlebar text
//
           ie.ToolBar = 0;
        }
     }
  }
}
sean_n - 17 Mar 2008 07:21 GMT
You can case the IE object to an IWebBrowserApp, then use the
LocationName property.  Seems like the LocationName is the same text
in the Titlebar.

           m_WebBrowser = (IWebBrowserApp)ie;
           if (m_WebBrowser != null)
           {
              if (m_WebBrowser.LocationName.Contains(args[0]))

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.