3

调用DwmExtendFrameIntoClientArea窗口后,如何在保持 Aero 模式时再次将其关闭?

我尝试调用 DwmExtendFrameIntoClientArea 并将所有边距设置为 0,这似乎可以部分工作,除了我的窗口客户区的背景全是黑色并显示重绘伪影。

我正在使用Qt,setAttribute(Qt::WA_TranslucentBackground, false)这样做后我调用了我的窗口,但它似乎没有任何效果。重置窗框后如何正确重绘客户区?

4

1 回答 1

4

Simple mistake - I also needed to set Qt::WA_NoSystemBackground to false so Qt would actually draw the window...

So, the procedure to turn off an extended frame is:

  • Call DwmExtendFrameIntoClientArea (misleading, right?) with all margins set to 0
  • Set WA_TranslucentBackground = false on the window (or non-Qt equivalent)
  • Set WA_NoSystemBackground = false on the window (or non-Qt equivalent)
于 2012-12-09T00:18:31.043 回答