diff --git a/EXeSetModifiedOff.h b/EXeSetModifiedOff.h new file mode 100644 index 0000000..102f7c5 --- /dev/null +++ b/EXeSetModifiedOff.h @@ -0,0 +1,45 @@ +//---------------------------------------------------------------------------- +// EgalTech 2017-2017 +//---------------------------------------------------------------------------- +// File : EXeSetModifiedOff.h Data : 04.01.17 Versione : 1.6x4 +// Contenuto : Dichiarazione classe per disabilitazione temporanea +// impostazione progetto modificato. +// +// +// Modifiche : 04.01.17 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EXeExecutor.h" + +//---------------------------------------------------------------------------- +class SetModifiedOff +{ + public : + explicit SetModifiedOff( void) { + m_bOldMod = ExeGetEnableModified() ; + ExeDisableModified() ; + m_nOldCtx = ExeGetCurrentContext() ; + } + ~SetModifiedOff( void) { + Reset() ; + } + void Reset( void) { + if ( ! m_bOldMod) + return ; + int nCurrCtx = ExeGetCurrentContext() ; + if ( nCurrCtx != m_nOldCtx) + ExeSetCurrentContext( m_nOldCtx) ; + ExeEnableModified() ; + if ( nCurrCtx != m_nOldCtx) + ExeSetCurrentContext( nCurrCtx) ; + m_bOldMod = false ; + } + + private : + bool m_bOldMod ; + int m_nOldCtx ; +} ;