简体   繁体   中英

How can I turn off DwmExtendFrameIntoClientArea?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM