Windows 中的全屏窗口 - 删除边框?

发布于 2024-08-28 03:40:18 字数 484 浏览 4 评论 0原文

许多 Windows 应用程序(游戏、Web 浏览器、某些编辑器等)支持全屏模式,其中应用程序的客户端区域覆盖整个屏幕。

作为一名 Win32 开发人员,我总是通过

  • 删除窗口的框架和标题栏,并将
  • 窗口的位置设置为(上、左、宽度、高度)=(0, 0, 屏幕宽度, 屏幕高度)来实现全屏。

另一种可能性是保留标题栏,并将位置设置为(-一些偏移,-一些偏移,屏幕宽度+一些偏移,屏幕高度+一些偏移)。

我认为我的解决方案听起来更安全,因为它不太依赖于系统指标和行为,但我想我已经见过后一种方案几次了。另外,在很多全屏程序(如Google Chrome、Internet Explorer等)中,仍然可以使用Alt+Space(或F10)来访问系统菜单,这表明已经使用了第二种方法。

但第二种方法的一个主要缺点肯定是,在多显示器系统上,全屏窗口的边框在其他屏幕上可见?

所以我的问题是:哪种方法最合适,哪种方法使用得最多?

Many Windows applications (games, web browsers, some editors, etc.) support fullscreen mode, in which the application's client area covers the entire screen.

As a Win32 developer, I have always implemented full-screen by

  • removing the window's frames and title bar, and
  • setting the window's position to (top, left, width, height) = (0, 0, screen width, screen height).

Another possibility is to keep the title bar, and set the position to (-some offset, -some offset, screen width + some offset, screen height + some offset).

I think that my solution sounds safer, in the sense that it does not depend as much on system metrics and behaviour, but I think I have seen the latter one a few times. In addtion, in many full-screen programs (such as Google Chrome, Internet Explorer, etc.), you can still use Alt+Space (or F10) to access the system menu, which indicates that the second method has been used.

But surely one major drawback of the second approach is that, on a multi-monitor system, the borders of the fullscreen window are visible on the other screens?

So my question is: which method is most appropriate and which is being used the most?

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

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

发布评论

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

评论(1

生生不灭 2024-09-04 03:40:18

获取 WinSpy++ 的副本,将其设置为始终位于顶部并以全屏模式检查一些浏览器窗口(IE6和Firefox 3.6都去掉了标题栏)

而且由于Firefox和Chrome都是开源的,你可以直接去查看源码:)

Grab a copy of WinSpy++, set it to always on top and inspect some browser windows in fullscreen mode (Both IE6 and Firefox 3.6 remove the titlebar)

And since both Firefox and Chrome are open source, you can just go and check the source :)

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