Windows 中的全屏窗口 - 删除边框?
许多 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
获取 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 :)