Example #1
0
        }// Page1


        protected override int WizSetActive(IntPtr hwnd)
        {
            // Find out which property page this is....
            switch (GetPropPage(hwnd))
            {
            // If this is the first page of our wizard, we want a
            // disabled next button to show
            case 0:
                if (Page1.Filename == null || Page1.Filename.Length == 0)
                {
                    TurnOnNext(false);
                }
                else
                {
                    TurnOnNext(true);
                }
                break;

            case 1:
                Page2.PutValuesinPage();
                TurnOnFinish(true);
                break;

            case 2:
                Page3.PutValuesinPage();
                TurnOnFinish(true);
                break;
            }
            return(base.WizSetActive(hwnd));
        }// WizSetActive
        }// IsHomeUser

        protected override int WizSetActive(IntPtr hwnd)
        {
            m_alNewCodeGroups.Clear();
            m_fWizardFinished = false;
            // Find out which property page this is....
            switch (GetPropPage(hwnd))
            {
            case 0:
                // Let's get our thread working...
                if (m_tLevels == null)
                {
                    m_tLevels = new Thread(new ThreadStart(DiscoverLevels));
                    m_tLevels.Start();
                }
                TurnOnNext(true);
                break;

            case 1:
                // Wait for these helper threads to finish
                SetThreadPriority(m_tLevels, ThreadPriority.Highest);
                m_tLevels.Join();

                // Grab the results of our threads...
                if (IsHomeUser)
                {
                    Page2.MaxLevels      = m_iMaxLevelsMachine;
                    Page2.SecurityLevels = m_iCurrentLevelsMachine;
                }
                else
                {
                    Page2.MaxLevels      = m_iMaxLevelsUser;
                    Page2.SecurityLevels = m_iCurrentLevelsUser;
                }

                // We need to put the values back in the page, since we
                // just changed all the security levels.
                Page2.PutValuesinPage();
                TurnOnNext(true);
                break;

            case 2:
                // See if machine level settings are going to be negated because
                // user policy is more strict
                bool fUserProblems = false;

                if (IsHomeUser)
                {
                    // Check what the max levels are in user policy
                    int[] levels = GetLevels(new PolicyLevel[]
                    {
                        Security.GenSecurityNode.UserNode.MyPolicyLevel,
                    });
                    // Now see if the machine levels are set higher than these levels
                    for (int i = 0; i < levels.Length; i++)
                    {
                        if (levels[i] < Page2.SecurityLevels[i])
                        {
                            fUserProblems = true;
                        }
                    }
                }
                Page3.UserProblems = fUserProblems;

                Page3.Init(Page2.SecurityLevels);
                TurnOnFinish(true);
                break;
            }
            return(base.WizSetActive(hwnd));
        }// WizSetActive