DwmExtendFrameIntoClientArea 和最大化窗口
我正在尝试构建一个漂亮的 GUI,在客户端区域具有一些玻璃效果。
所以我按照此处的描述实现了它。
我很成功,并且拥有完全由玻璃制成的漂亮框架,但前提是窗口没有最大化。当我最大化窗口时,它只是黑色:-(
通过一些谷歌搜索和实验,我发现,当我响应 WM_WINDOWPOSCHANGING
使窗口无效时,如下所示:
case WM_WINDOWPOSCHANGING: {
WINDOWPOS* pWindowPos = (WINDOWPOS*)lParam;
if (pWindowPos->flags & SWP_FRAMECHANGED) {
InvalidateRect(hWnd, NULL, TRUE);
}
}
我也会得到玻璃效果我现在最大化窗口,
这只有在我双击标题栏或窗口右上角的最大化按钮时才有效,但是如果我将窗口移动到屏幕顶部。让它折断最大化窗口(Aero Snap)时,窗口会变成黑色。
有人知道这是如何完成的吗?
(我正在 Windows 7 64 位下开发。)
编辑:
我还应该提到。我想删除标准标题栏,我通过返回 0
来响应 WM_NCCALCSIZE
消息,如果没有这个,一切都会正常工作
编辑:<。 /strong>
在另一个系统上的测试,即基本上相同的是成功的。唯一显着的区别是有另一个显卡,AMD Radeon HD 4300 而不是 AMD Radeon HD 5870。这可能是显卡驱动程序的问题吗?
I am trying to build a nice GUI with some glass effect in the client area.
So I implemented it as described here.
I was successful and have nice frame fully of glass, but only as long the window is not maximized. When I maximize the window it is only black :-(
With some googleing and experimenting I figured out, that when I invalidate the the window in response to a WM_WINDOWPOSCHANGING
like this:
case WM_WINDOWPOSCHANGING: {
WINDOWPOS* pWindowPos = (WINDOWPOS*)lParam;
if (pWindowPos->flags & SWP_FRAMECHANGED) {
InvalidateRect(hWnd, NULL, TRUE);
}
}
I get the glass effect also when I maximize the window.
The odd thing now is that this is only working if I double click on the title bar or this the maximize button on the right top corner of the window. But if I move the window to the top of the screen to let it snap there to maximize the window (Aero Snap) the window turns just black.
Does anyone has a idea how this is done right?
(I am developing under Windows 7 64 bit.)
Edit:
I should also mention that I want to remove the standard title bar, I doing so by returning 0
in response to a WM_NCCALCSIZE
message. Without this everything is working fine.
Edit:
A test on another system, which is basically the same was successful. The only notable difference is that there is another graphics card, a AMD Radeon HD 4300 instead of a AMD Radeon HD 5870. Could this be a issue with the driver of the graphics card?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论