Listing 1 Abridged version of window_update_scope
/* ///////////////////////////////////////////////////////////// * * ... * * Extract from winstl_window_update_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_update_scope { // Construction public: // Takes a HWND and changes it's current update-status, // which is set back to the original state in the // destructor. ws_explicit_k window_update_scope(HWND hwnd) : m_bIsLocked(hwnd != NULL && ::LockWindowUpdate(hwnd)) {} ~window_update_scope() winstl_throw_0() { if(m_bIsLocked) { // Lock was successful, so undo here ::LockWindowUpdate(NULL); } } // Members protected: ws_bool_t m_bIsLocked; // Not to be implemented private: window_update_scope(window_update_scope const &rhs); window_update_scope const &operator =(window_update_scope const &rhs); }; } // namespace winstl