Question

My application has a standard top level window for the application. I need to force a repaint of the window chrome (otherwise known as the non-client area of the window). I do not care if the client area is also repainted or not but the chrome itself needs to be forced to repaint.

In particular I need this to work on Windows 7. Whether it works on other OS versions does not matter in my particular case. The solution can be C, C++, C# or any other language.

Was it helpful?

Solution

According to MSDN, it seems that

RedrawWindow( hWnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME );

is what you are looking for.

RDW_FRAME causes any part of the nonclient area of the window that intersects the update region to receive a WM_NCPAINT message. The RDW_INVALIDATE flag must also be specified; otherwise, RDW_FRAME has no effect. The WM_NCPAINT message is typically not sent during the execution of RedrawWindow unless either RDW_UPDATENOW or RDW_ERASENOW is specified.

OTHER TIPS

maybe you could send the WM_NCPAINT message to the window

http://msdn.microsoft.com/en-us/library/dd145212%28VS.85%29.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top