Source code of Windows XP (NT5)
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.

61 lines
1.8 KiB

  1. var L_FriendlyUI_ErrorMessage = "Unable to set friendly UI setting.";
  2. var L_MultiUser_ErrorMessage = "Unable to set multiple user setting.";
  3. var _nFriendlyUIEnabled = 0;
  4. var _nMultipleUsersEnabled = 0;
  5. function PageInit()
  6. {
  7. var oLocalMachine = new ActiveXObject("Shell.LocalMachine");
  8. _nFriendlyUIEnabled = oLocalMachine.isFriendlyUIEnabled;
  9. _nMultipleUsersEnabled = oLocalMachine.isMultipleUsersEnabled;
  10. idWelcome.checked = (1 == _nFriendlyUIEnabled);
  11. idShutdown.checked = (0 == _nMultipleUsersEnabled);
  12. }
  13. function ApplyAdvChanges()
  14. {
  15. var nErr = 0;
  16. if (idWelcome.checked != _nFriendlyUIEnabled)
  17. {
  18. try
  19. {
  20. var oLocalMachine = new ActiveXObject("Shell.LocalMachine");
  21. oLocalMachine.isFriendlyUIEnabled = idWelcome.checked;
  22. _nFriendlyUIEnabled = idWelcome.checked;
  23. }
  24. catch (error)
  25. {
  26. nErr = (error.number & 0xffff);
  27. idWelcome.checked = (1 == _nFriendlyUIEnabled);
  28. alert(L_FriendlyUI_ErrorMessage);
  29. }
  30. }
  31. if (idShutdown.checked == _nMultipleUsersEnabled)
  32. {
  33. try
  34. {
  35. var oLocalMachine = new ActiveXObject("Shell.LocalMachine");
  36. oLocalMachine.isMultipleUsersEnabled = idShutdown.checked ? 0 : 1;
  37. _nMultipleUsersEnabled = idShutdown.checked ? 0 : 1;
  38. }
  39. catch (error)
  40. {
  41. nErr = (error.number & 0xffff);
  42. idShutdown.checked = (0 == _nMultipleUsersEnabled);
  43. // There are 2 possible errors here. Need to check with
  44. // VTan about what they are, then make 2 different messages.
  45. alert(L_MultiUser_ErrorMessage);
  46. }
  47. }
  48. if (0 == nErr)
  49. window.external.navigate("{C9332CBE-E2D6-4722-B81D-283E2A400E84}", true);
  50. }