Code List 2 Window_redraw_scope
/ * /
*
* ...
*
* Extract from Winstl_Window_Redraw_scope.h
* Excerpted from WinSTL_Window_redraw_scope.h
*
* www: http://www.synsis.com.au/winstel
* Http://www.winstl.org/
*
* Copyright (C) 2002, SYNESS Software Pty Ltd.
* Copyright (C) 2002, SYNESS SOFTWARE PTY LTD
* (Licensed Under The Synesis Software Standard Source License:
* Http://www.synsis.com.au/licenses/ssssl.html)
* (Authorized license by Synes Software Standard Source License:
* Http://www.synsis.com.au/licenses/ssssl.html)
*
* ...
*
* // * /
...
Namespace Winstl
{
Class window_redraw_scope
{
// construction
// Structure
PUBLIC:
// Takes a hwnd and changes it's current redraw-status,
// Which is set back to the Original State in The
// deStructor.
// Take the HWND handle and change its current redraw status, set it back to the initial 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_SETREDREDREDREDRAW, FALSE, 0L);
}
~ window_redraw_scope () WINSTL_THROW_0 ()
{
:: SendMessage (M_HWND, WM_SETREDREDREDRAW, TRUE, 0L);
IF (M_binvalidateonUnlock)
{
:: INVALIDATERECT (M_HWND, NULL, TRUE);
}
}
//Members
// Member variables
protected:
HWND M_HWND;
WS_BOOL_T M_BINVALIDATEONUNLOCK;
// not to be mentionable
// is not implemented
Private:
Window_redraw_scope; window_redraw_scope const & rhs;
WINDOW_REDRAW_SCOPE CONST
& operator = (Window_redRaw_Scope Const & RHS);
}
} // Namespace WinSTL namespace
Chart 1 WINDOW Scope (Scope) example