Listing 2 Abridged version of window_redraw_scope
/* ///////////////////////////////////////////////////////////// * * ... * * Extract from winstl_window_redraw_scope.h * * www: http://www.synesis.com.au/winstl * http://www.winstl.org/ * * Copyright (C) 2002, Synesis Software Pty Ltd. * (Licensed under the Synesis Software Standard Source License: * http://www.synesis.com.au/licenses/ssssl.html) * * ... * * ////////////////////////////////////////////////////////// */ ... namespace winstl { class window_redraw_scope { // Construction public: // Takes a HWND and changes it's current redraw-status, // which is set back to the original state in the // destructor. ws_explicit_k window_redraw_scope(HWND hwnd, ws_bool_t bInvalidateOnUnlock = true) : m_hwnd(hwnd) , m_bInvalidateOnUnlock(bInvalidateOnUnlock) { ::SendMessage(m_hwnd, WM_SETREDRAW, false, 0L); } ~window_redraw_scope() winstl_throw_0() { ::SendMessage(m_hwnd, WM_SETREDRAW, true, 0L); if(m_bInvalidateOnUnlock) { ::InvalidateRect(m_hwnd, NULL, true); } } // Members protected: HWND m_hwnd; ws_bool_t m_bInvalidateOnUnlock; // Not to be implemented private: window_redraw_scope(window_redraw_scope const &rhs); window_redraw_scope const &operator =(window_redraw_scope const &rhs); }; } // namespace winstl