문제

After I've called DwmExtendFrameIntoClientArea on a window, how can I turn it off again while remaining in Aero mode?

I've tried to call DwmExtendFrameIntoClientArea with all margins set to 0, which seems to work partially except that the background of the client area of my window is all black and exhibits redrawing artifacts.

I'm using Qt, and I call setAttribute(Qt::WA_TranslucentBackground, false) on my window after doing this, but it seems to have no effect. How can I get the client area to be redrawn correctly after resetting the window frame?

도움이 되었습니까?

해결책

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top