Three C ++ skills

zhaozj2021-02-16  43

Code List 1 Window_Update_scope

/ * /

*

* ...

*

* Extract from winstl_window_update_scope.h

* Extracted from WinSTL_Window_UPDATE_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_update_scope

{

// construction

// Structure

PUBLIC:

// takes a hwnd and change it's current update-status,)

// Which is set back to the Original State in The

// deStructor.

// obtain the HWND handle and change its current update state, set it back to the initial 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

// Lock success, thus reverse operation

:: LockWindowUpdate (null);

}

}

//Members

//Member variables

protected:

WS_BOOL_T M_BISLOCKED;

// not to be mentionable

// is not implemented

Private:

WINDOW_UPDATE_SCOPE (Window_Update_scope const & rhs);

WINDOW_UPDATE_SCOPE ConST

& operator = (Window_Update_scope const & rhs);

}

} // Namespace WinSTL

// Name Space WinSTL

转载请注明原文地址:https://www.9cbs.com/read-22664.html

New Post(0)