【问题标题】:Display Internet Options like Internet Explorer显示 Internet 选项,例如 Internet Explorer
【发布时间】:2014-10-04 00:02:37
【问题描述】:

我正在使用以下代码在我的 Web 浏览器控件中显示 Internet 选项:

Process.Start("InetCpl.Cpl");

但是,这会为 Internet 选项创建一个独立于我的 MainWindow 的新窗口。

我需要显示 Internet 选项,例如 Internet Explorer,即 MainWindow UI 应该被阻止并且 Internet 选项窗口应该在 MainWindow 内打开。

任何帮助将不胜感激。 提前致谢。

【问题讨论】:

  • 通常你会使用 "Process p = Process.Start("Notepad.exe"); p.EnableRaisingEvents = true; p.Exited += new EventHandler(p_Exited);"但这不适用于控制面板应用程序,因为一旦进程运行,Exited 事件就会被触发。

标签: c# wpf system.diagnostics


【解决方案1】:

您可以尝试直接调用启动函数。 将启动函数导入您的类中

[DllImport("inetcpl.cpl", SetLastError = true)]
public static extern int LaunchInternetControlPanel(IntPtr hWnd);    

并从您的命令中调用它

LaunchInternetControlPanel(this.Handle);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-03
    • 2010-12-28
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    • 1970-01-01
    • 2014-06-16
    相关资源
    最近更新 更多