Question

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?

Was it helpful?

Solution

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top