Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. //=============================================================================
  2. // Implementation for some functions in the CPageBase class (most are
  3. // implented inline in the .h file). For descriptions of usage, refer to the
  4. // header file.
  5. //=============================================================================
  6. #include "stdafx.h"
  7. #include <atlhost.h>
  8. #include "MSConfig.h"
  9. #include "MSConfigState.h"
  10. #include "PageBase.h"
  11. //-----------------------------------------------------------------------------
  12. // GetAppliedTabState()
  13. //-----------------------------------------------------------------------------
  14. CPageBase::TabState CPageBase::GetAppliedTabState()
  15. {
  16. TabState tabstate = NORMAL;
  17. CRegKey regkey;
  18. regkey.Attach(GetRegKey(_T("state")));
  19. if ((HKEY)regkey != NULL)
  20. {
  21. DWORD dwValue;
  22. if (ERROR_SUCCESS == regkey.QueryValue(dwValue, GetName()))
  23. tabstate = (TabState)dwValue;
  24. }
  25. return tabstate;
  26. }
  27. //-----------------------------------------------------------------------------
  28. // SetAppliedState()
  29. //-----------------------------------------------------------------------------
  30. void CPageBase::SetAppliedState(TabState state)
  31. {
  32. CRegKey regkey;
  33. regkey.Attach(GetRegKey(_T("state")));
  34. if ((HKEY)regkey != NULL)
  35. regkey.SetValue((DWORD)state, GetName());
  36. }