IE Toolbars

G

Guest

I'm working on a web application that hides all of the tool bars in IE from
the user. I know there are a number of discussion about not doing this. It's
a third party application that I'm adding fucntionality to through the tool
bars. I can turn the toolbars back on but I get everything the Menubar,
addressbar, standardbuttons bar, and linksbar. I would like to only turn on
the links bar for the user that will have a number of shortcuts on it. I can
also easily turn off the addressbar and the menubar in code but haven't found
a way to remove all the remaining toolbars but the links one. Is there
someplace that I can itterate through to find out what toolbars are installed
in IE and disable them?

Thanks, Curt
 
N

Nicholas Paldino [.NET/C# MVP]

Curt,

What kind of mechanism are you using to do this? Are you automating an
instance of IE, or are you trying to do this through javascript? Can you
show some example code?
 
G

Guest

I'm using SHDocVw to get a running instance of IE6. Then I was looping
through the the registry to find what toolbars had been installed under
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar then calling
Showbrowserbar(classid, state, size) passing in the classid from the
registry. It works pretty well but I'm not able to hide the standard buttons
bar. It looks like there isn't a classid key for that toolbar and I don't
have any idea where to find it or how to turn it off.

Here is the 2 subs that I'm using.
static void SearchSubKeys(RegistryKey root)
{
foreach (string valuename in root.GetValueNames())
{

//MessageBox.Show(valuename.ToString());
HideBrowserToolbars(valuename, false);
}

foreach (string keyname in root.GetSubKeyNames())
{
try
{
using (RegistryKey key = root.OpenSubKey(keyname))
{
foreach (string valuename in key.GetValueNames())
{

//MessageBox.Show(valuename.ToString());
HideBrowserToolbars(valuename, false);
}

SearchSubKeys(key);
}
}
catch (System.Security.SecurityException)
{
}
}
}


static void HideBrowserToolbars(string sClsid, bool bShow)
{
object objClsid = (object)sClsid;
object objShow = (object)bShow;
object objSize = null;

if (bShow) /* hide Browser bar before showing to prevent erroneous behavior
of IE*/
{
object pvarShowFalse = (object)false;
browser.ShowBrowserBar(ref objClsid, ref objShow, ref objSize);
}

browser.ShowBrowserBar(ref objClsid, ref objShow, ref objSize);


}


Nicholas Paldino said:
Curt,

What kind of mechanism are you using to do this? Are you automating an
instance of IE, or are you trying to do this through javascript? Can you
show some example code?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Curt said:
I'm working on a web application that hides all of the tool bars in IE
from
the user. I know there are a number of discussion about not doing this.
It's
a third party application that I'm adding fucntionality to through the
tool
bars. I can turn the toolbars back on but I get everything the Menubar,
addressbar, standardbuttons bar, and linksbar. I would like to only turn
on
the links bar for the user that will have a number of shortcuts on it. I
can
also easily turn off the addressbar and the menubar in code but haven't
found
a way to remove all the remaining toolbars but the links one. Is there
someplace that I can itterate through to find out what toolbars are
installed
in IE and disable them?

Thanks, Curt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Windows Explorer won't display any Toolbars 3
Toolbars 2
IE8 2
Toolbars Disable/Enable 2
hide IE toolbars 1
Removing and Restoring Excel toolbars 3
Tool bars keep moving around 1
How to turn OFF visual styles 1

Top