在 Windows 中通过命令行启动没有菜单/地址栏的 IE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8174286/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
start IE with no menu/address bar through command line in Windows
提问by Stefan
Is there a way to start IE with a bare window (not kiosk mode, needs to have the close button) through a command line option?
有没有办法通过命令行选项使用裸窗口(不是 kiosk 模式,需要有关闭按钮)启动 IE?
We have some pages in an internal web-app that needs alot of screen realestate and we only need the HMTL rendering of the browser not the other stuff.
我们在一个内部网络应用程序中有一些页面需要大量的屏幕空间,我们只需要浏览器的 HMTL 渲染而不是其他东西。
I found http://www.quero.at/launcher.phpbut the last update is 5 years old.
我找到了http://www.quero.at/launcher.php但最后一次更新是 5 岁。
How to remove IE toolbar and menu barSimilar question but no answer.
如何删除 IE 工具栏和菜单栏类似的问题,但没有答案。
回答by Ofir Meguri
The best way to do it with .net is by console application with reference to the COM object of IE.
使用 .net 执行此操作的最佳方法是通过控制台应用程序参考 IE 的 COM 对象。
Instructions:
说明:
Create new console application in VS and reference to the Microsoft Internet Controls (SHDocVw) type library.
在 VS 中创建新的控制台应用程序并引用 Microsoft Internet Controls (SHDocVw) 类型库。
Example in c#:
C# 中的示例:
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
ie.Navigate(url);
ie.ToolBar = 0;
ie.AddressBar = false;
ie.Visible = true;
see more details at msdn: http://msdn.microsoft.com/en-us/library/aa752084(v=vs.85).aspx
在 msdn 上查看更多详细信息:http: //msdn.microsoft.com/en-us/library/aa752084(v=vs.85) .aspx
回答by Raymond Chen
var ie = new ActiveXObject("InternetExplorer.Application");
ie.Navigate("C:\sample.htm");
ie.AddressBar = false;
ie.MenuBar = false;
ie.ToolBar = false;
// ... etc ... customize your heart out
ie.Visible = true;
回答by Infinity
create a small .net application with embed browser control in it, like a windows form with embedded Internet component on it.
创建一个小的 .net 应用程序,其中嵌入了浏览器控件,就像一个带有嵌入 Internet 组件的 Windows 窗体。
check this out form more information## Heading ##
查看此表单更多信息## 标题##
回答by dmarietta
You could always just run an embedded instance of Internet Explorer in a window within your app. This way the container can be whatever size you specify in your own window and the embedded instance of IE can be any size you want with that, without any of the normal browser toolbars/menus.
您始终可以在应用程序的窗口中运行嵌入式 Internet Explorer 实例。这样,容器可以是您在自己的窗口中指定的任何大小,并且 IE 的嵌入式实例可以是您想要的任何大小,而无需任何普通的浏览器工具栏/菜单。
If you mention what you are developing your app in, might be able to point you to some references.
如果您提到您正在开发应用程序的内容,也许可以为您提供一些参考资料。