This behaviour appears to be by design:
[color=green]// Hiding then showing is the only way I've discovered to make it update. If the window
// is not updated, a strange effect occurs where the window is still visible but can no
// longer be used at all (clicks pass right through it). This show/hide method is less
// desirable due to possible side effects caused to any script that happens to be watching
// for its existence/non-existence, so it would be nice if some better way can be discovered
// to do this.
// SetWindowPos is also necessary, otherwise the frame thickness entirely around the window
// does not get updated (just parts of it):[/color]
SetWindowPos(mHwnd, NULL, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
ShowWindow(mHwnd, SW_HIDE);
ShowWindow(mHwnd, SW_SHOWNA); [color=green]// i.e. don't activate it if it wasn't before. Note that SW_SHOWNA avoids restoring the window if it is currently minimized or maximized (unlike SW_SHOWNOACTIVATE).
// None of the following methods alone is enough, at least not when the window is currently active:
// 1) InvalidateRect(mHwnd, NULL, TRUE);
// 2) SendMessage(mHwnd, WM_NCPAINT, 1, 0); // 1 = Repaint entire frame.
// 3) RedrawWindow(mHwnd, NULL, NULL, RDW_INVALIDATE|RDW_FRAME|RDW_UPDATENOW);
// 4) SetWindowPos(mHwnd, NULL, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);[/color]