Skip to content

Instantly share code, notes, and snippets.

@katopz
Created July 8, 2013 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katopz/5947579 to your computer and use it in GitHub Desktop.
Save katopz/5947579 to your computer and use it in GitHub Desktop.
Open Internet Explorer -> hide menu bar, tool bar, status bar -> adjust width/height ->load local storage
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.ComponentModel;
namespace Foo
{
public class Bar
{
public static void Main()
{
string currentPath = Environment.CurrentDirectory;
/*
Just open it
Process.Start("IExplore.exe", currentPath+"\\contents\\home.html");
*/
System.Type oType = System.Type.GetTypeFromProgID("InternetExplorer.Application");
object o = System.Activator.CreateInstance(oType);
o.GetType().InvokeMember("menubar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });
o.GetType().InvokeMember("toolbar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });
o.GetType().InvokeMember("statusBar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });
o.GetType().InvokeMember("addressbar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });
o.GetType().InvokeMember("Visible", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { true });
o.GetType().InvokeMember("Width", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 1050 });
o.GetType().InvokeMember("Height", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 768 });
o.GetType().InvokeMember("Navigate", System.Reflection.BindingFlags.InvokeMethod, null, o, new object[] { currentPath + "\\contents\\home.html" });
}
}
}
@sagarjain094
Copy link

This Code Opens up the IE browser in Background and not on top of visual studio..how do i make it show on top of visual studio?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment