自定义窗口标题/边框:WM_NCCALCSIZE和OpenGL上下文 [英] custom window caption/borders: WM_NCCALCSIZE and OpenGL context

查看:134
本文介绍了自定义窗口标题/边框:WM_NCCALCSIZE和OpenGL上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我有这个opengl应用程序,我想画自己的边框/标题。

另外,我不能(大概)有无边框窗口,因为我想要aero snap功能,dbl点击最大化等等。


至少这是Visual Studio的表现。 


我遇到的问题是 - 当aero启用时(并且它在win 7上) - 覆盖WM_NCCALCSIZE并且撤回零并没有真正摆脱窗口标题。窗口在非客户区域中只有隐形字幕,虽然边界似乎被抽出。


我没有具体的问题,我只是在尝试下面的非客户端绘图是有效的,为什么会这样做。

我不确定它是否是opengl问题,或者我没有正确处理WM_NCCALCSIZE,或其他什么。


经典主题似乎运作良好。 opengl在标题上绘制得很好,我只需要在最大化模式下调整客户区位置。


另外,有趣的是Visual Studio不像所有其他自定义边框应用程序那样使用WS_POPUP (如Steam,Telegram)。事实上,WS_POPUP似乎解决了我的问题。


同样,我只是想了解它是如何工作的,因为这些事情并没有真正记录下来。实施它们感觉有点hacky。而且我认为我最终将使用标准的Windows边框发货。


所以我很感激有关这方面的任何信息。谢谢!





解决方案

如果您已经完成了互联网搜索,那么您可能已经看过这篇博文,但如果您错过了它,也许它会有所帮助:

Scrollbars第11部分:更深入地了解WM_NCCALCSIZE消息

Hi!

I have this opengl app and I want to draw my own borders/caption.
Also, I cant (presumably) have borderless window because I want aero snap features, dbl click to maximize etc.

At least that's how Visual Studio seems to do it. 

The problem i have is - when aero is enabled (and it's on win 7) - overriding WM_NCCALCSIZE and returing zero does not really get rid of the window caption. The window just has invisible caption in non-client area, although borders do seem to be drawn over.

I dont have a specific question, I'm just trying undersatnd how the non-client drawing works and why it does that.
I'm not sure if it's opengl issue or I'm not processing WM_NCCALCSIZE properly, or something else.

Classic theme seems to work well. opengl draws fine over the caption, and I just have to adjust client area position in maximized mode.

Also, interestingly Visual Studio doesn't use WS_POPUP, like all the other custom-border apps (like Steam, Telegram). And indeed WS_POPUP does seem to solve my issue.

Again, I'm just trying to understand how this works, because there these kind of things aren't really documented. And implementing them feels a bit hacky. And I think I'll end up shipping with standard windows border.

So I'd appreciate any information on this. Thanks!


解决方案

If you have done an Internet search then you have probably already seen this blog post, but in case you missed it, maybe it will be of some help: Scrollbars part 11: Towards an even deeper understanding of the WM_NCCALCSIZE message


这篇关于自定义窗口标题/边框:WM_NCCALCSIZE和OpenGL上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆