如何从 C# 桌面应用程序以全屏模式打开默认浏览器?

发布于 2024-12-23 07:31:17 字数 661 浏览 2 评论 0原文

嗨&感谢您的关注!

如何从 C# 桌面应用程序以全屏模式打开默认浏览器?我在SO上看到了类似的问题:

如何在默认浏览器中打开在 C# 中

。 。但没有任何解决方法可以从 C# 在全屏浏览器窗口中打开本地 HTML 文件(C: 驱动器)。

我可以使用以下命令打开窗口:

Process.Start("http://google.com");

但是如何使其默认为全屏?有没有办法模拟 F11 按键,甚至更直接的方法?

编辑:理想情况下,我不需要打开表格。我不想混淆这个问题,但我正在试验 Kinect 语音识别引擎,并将在系统托盘中运行一个程序,始终监听。我已经达到了可以说出命令并且它会的程度。 。 。

//do stuff

。 。在这种情况下,我只希望它以全屏模式打开默认浏览器。

因此,我不必能够在全屏和常规屏幕之间来回切换,只需以全屏启动即可。我在想 F11 新闻机的模拟将是答案,但听起来我需要为此打开一个表格?

谢谢!

马特

Hi & thanks for looking!

How do I open default browser in fullscreen mode from a C# desktop application? I have seen similar questions on SO:

How to open in default browser in C#

. . .BUT nothing addresses opening a local HTML file (C: drive) in a FULLSCREEN browser window from C#.

I can open the window using this:

Process.Start("http://google.com");

But how do I make it default to fullscreen? Is there a way to simulate the F11 key press, or even something more direct?

EDIT: Ideally, I will not need to have a form open. I don't want to confuse the issue, but I am experimenting with the Kinect Speech Recognition engine and will have a program running in the system tray, always listening. I already have it to a point that I can say a command and it will. . .

//do stuff

. . .and in this case, I just want it to open the default browser in fullscreen mode.

So, I don't have to be able to toggle back and forth between fullscreen and regular screen, just launch in fullscreen. I was thinking that a simulation of the F11 press would be the answer, but it sounds like I need a form open for this??

Thanks!

Matt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尬尬 2024-12-30 07:31:17

为此,您需要使用 sendkeys

查找在列表中您需要类似的内容:

ActiveForm.SendKeys("{F11}");

希望能解决您的问题。

For that you would need to use sendkeys

Looking at the list you need something like:

ActiveForm.SendKeys("{F11}");

Hope that solves your issue.

南风几经秋 2024-12-30 07:31:17

SendKeys 不需要代替

ActiveForm.SendKeys.Send("{F11}"); 

ActiveForm.SendKeys("{F11}");

wouldn't the SendKeys need to be

ActiveForm.SendKeys.Send("{F11}"); 

instead of

ActiveForm.SendKeys("{F11}");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文